Skip to main content

Very simple signed Webtart app throwing AccessControlException

1 reply [Last post]
aidano
Offline
Joined: 2003-07-08
Points: 0

I have a Webstart app deployed locally on a Tomcat server. It's signed using my own generated certificate,a and only one JAR file is used containing two classes - no 3rd party JARs or anything like that. It's a simple Swing application which creates a Preferences object like so:

Preferences prefs = java.util.prefs.Preferences.userNodeForPackage(TicTacToe.class);

I access the code like this:

http://192.168.1.100:8080/Test/Test.jnlp

When the app runs, I don't get the Security warning dialog which I expect for a signed JAR. The app runs automatically and I see this exception in the console:

Exception in thread "AWT-EventQueue-0" java.security.AccessControlException: access denied (java.lang.RuntimePermission preferences)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.util.prefs.Preferences.userRoot(Unknown Source)
at java.util.prefs.Preferences.userNodeForPackage(Unknown Source)

My JNLP file seems correct and has the

block to grant all permissions.

What could be going wrong here? From what I've read, a self-signed cert should work, and should show a Security dialog warning not to run the application. I'm running with Java Web Start 1.5.0_02.

I'd appreciate any ideas!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
aidano
Offline
Joined: 2003-07-08
Points: 0

Fixed. I had my block in the JNLP file as a child of and the applet was acting as a non-signed app (with no warning dialog) because of this.