applet access denied to java.io.tmpdir
I have an applet that I'm developing in Eclipse. When I run it with the Eclipse Applet Viewer it works fine but when I try to run it from my local copy of Tomcat I get the following error:
java.security.AccessControlException: access denied (java.util.PropertyPermission java.io.tmpdir read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Is this a problem with the applet or possibly a problem with the server setup? I haven't been able to find anything online. Any help is greatly appreciated.
Thanks for your posting. I had the problem about a week later. It turns out that PDFParser.java in the package PDFBox attempts to get a temporary file on the user's disk. In a Java applet this is not allowed, hence your AccessControlException.
I got around this by placing my code in a signed JAR file, and signed the PDFBox JAR file as well (I didn't check to see if this was necessary). Once I accepted the certificate, Java allowed PDFParser to read and write temporary files.
I posted a similar query in the "Bugs" forum at http://www.pdfbox.org/, in the hopes that the author will find a way to fix this problem. May I suggest that you do the same, as the more people with the same request, the more likely it will be fixed.
As for the program working in Eclipse but not in Tomcat, I would have to speculate that Eclipse is not setting up the normal applet restrictions for you. As I've never used either, I can only speculate on this point.
By kalamelka in forum Database
Last Post: 09-03-2013, 04:59 AM
By RossOliver in forum VB Classic
Last Post: 03-16-2006, 06:23 PM
By Aruna in forum ASP.NET
Last Post: 04-30-2002, 02:07 PM
By Prabhakar in forum ASP.NET
Last Post: 04-29-2002, 07:34 PM
By Ryan in forum VB Classic
Last Post: 04-25-2000, 04:11 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL