• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

AccessControlException - RuntimePermission

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.

Posts: 43016
  • 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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
Grow your own food... or this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic