1

Trying to run my program through java web start. I get the following exception in the output console. Im new to java web start so do any of you have any ideas?

FYI, here is line 66

ConfigFileReader cfg = new ConfigFileReader(BCApp.getConfigFileLocation());

java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.javaws.Launcher.executeApplication(Unknown Source)
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
    at com.sun.javaws.Launcher.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
    at JCS.Main$setStyle.setStyle(Main.java:66)
    at JCS.Main.main(Main.java:57)
    ... 9 more
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission java.io.tmpdir read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at GUI.BCApp.(BCApp.java:60)
    ... 11 more

2 Answers 2

2

You are going to want to read up on the security manager. Because code launched through Java Web Start could potentially cause grave harm to client computers there are a lot of things it is usually not allowed to do. File system access is one of them. There are several ways to enable your Java Web Start app to access the file system detailed in the documentation.

Sign up to request clarification or add additional context in comments.

3 Comments

In this case trying to read a system property that isn't allowed in an untrusted context.
So I signed my jar on the server. I have this file with a .cer extension. What do I do with this file as far as the client goes?
@user489041 - use keytool as described with the .cer. Sounds like you have already used jarsigner, but if not do that. After that your jar should be signed and the user can accept the signature (or it will automatically be accepted if from one of the trusted authorities).
1

Your WS application runs from a security sandbox environment, which means it doesn't have an access to the file system, unless a) your app is digitally signed or b) you can modify your security settings (which is not recommended btw).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.