Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Very simple signed Webtart app throwing AccessControlException
I have a Webstart app deployed locally on a Tomcat server. It's signed
using keytool/jarsigner with the 1.4.2_06 JDK and my own generated
certificate, 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

<security>
<all-permissions/>
</security>

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!


Report this thread to moderator Post Follow-up to this message
Old Post
aidanOL@gmail.com
06-04-05 01:58 AM


Re: Very simple signed Webtart app throwing AccessControlException
That's WebStart, not Webtart :)


Report this thread to moderator Post Follow-up to this message
Old Post
aidanOL@gmail.com
06-04-05 01:58 AM


Re: Very simple signed Webtart app throwing AccessControlException
Ok, I got it going. For reference what I did wrong was that I had this
block:

<security>
<all-permissions/>
</security>

in the wrong place in the JNLP file. I misplaced it under the
<information> tag and due to this the app was running the app as a
regular non-signed application.

I do find it odd though, that even though my jar file was signed, I
didn't receive any security dialog on startup.


Report this thread to moderator Post Follow-up to this message
Old Post
Aidan
06-06-05 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Security archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:48 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.