This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AccessControlException - RuntimePermission

 
Merril Peterson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a java.lang.AccessControlPermission: access denied (java.lang.RuntimePermission) when trying to load an Applet. I get this using IE6, Netscape4.7, and Netscape7. My applet doesn't make any socket connections or try to read any files. It simply fails to initialize and produces a stack trace with the AccessControlException. The applet code is located in a jar file and I believe I have it listed correctly in the codebase parameter of the applet tag.

Here's the funny part. I know I can run a specific applet (and it appears to be the only one I can run). That applet is loaded on the WEB server of a Lantronix UDS-10B card. It is the applet that is used to configure the card and comes preloaded on the card. If I try to run any other applet from the Lantronix card or any other web server I get the AccessControlException

If I couldn't run the Lantronix applet I would think it was a policy problem. I am at a loss of what to look at to debug the problem. I have written many applets before and think I understand the "security sandbox" an applet runs in. Any help/guidance would be appreciated.

thanks.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

First off, your display name does not comply with the standard required here (which specifies that it needs to be not obviously fictitious). Please change it accordingly.

As to debugging the problem, insert System.out.println statements liberally in your init code, in order to pinpoint the line in which the exception occurs. If you figure out which line it is, post it here. You could also post the full stack trace of the exception - there may be something in it that could give us a clue.
 
Merril Peterson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf,

Thanks. I cannot put in the StackTrace (isolated network). I did, however, take another hard look at the stack trace before I keyed it all in and found the answer. I had a JFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) statement in the JFrame constructor. I did not realize that that would cause the AccessControlException - RuntimePermission exception. I removed the statement and the applet loads fine.

Thanks again for responding and pointing me in the right direction.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic