-
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 org.pdfbox.pdfparser.PDFParser.<init>(PDFParser.java:72)
at org.pdfbox.pdfparser.PDFParser.<init>(PDFParser.java:85)
at org.pdfbox.pdmodel.PDDocument.load(PDDocument.java:577)
at FormApplet.updatePreview(FormApplet.java:292)
at FormApplet.initDoc(FormApplet.java:220)
at FormApplet.initComponents(FormApplet.java:104)
at FormApplet.init(FormApplet.java:79)
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.
007
-
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.
-
Similar Threads
-
By RossOliver in forum VB Classic
Replies: 4
Last Post: 03-16-2006, 05:23 PM
-
By kalamelka in forum Database
Replies: 4
Last Post: 09-23-2005, 11:37 AM
-
By Aruna in forum ASP.NET
Replies: 1
Last Post: 04-30-2002, 01:07 PM
-
By Prabhakar in forum ASP.NET
Replies: 0
Last Post: 04-29-2002, 06:34 PM
-
By Ryan in forum VB Classic
Replies: 5
Last Post: 04-25-2000, 03:11 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks