• 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

AccessControlException - RuntimePermission

 
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.
 
Rancher
Posts: 43016
76
  • 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.
 
Grow your own food... or this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic