Skip to main content

Webstart access denied JDIC

3 replies [Last post]
v_outulny
Offline
Joined: 2007-09-05
Points: 0

Hi,
I use in my application WebBrowser from JDIC. When I run my application as desktop application, everything is Ok. When I run with Java WebStart, application start Ok, but when I login and show JFrame with WebBrowser I get exception java.security.AccessControlException: access denied (java.util.PropertyPermission javawebstart.version read). Jars are signed and tag is in JNLP file. I use OS Vista, JDIC 0.9.3 and JDK 1.6_02
Please help.

org.jdesktop.jdic.init.JdicInitException: java.security.AccessControlException: access denied (java.util.PropertyPermission javawebstart.version read)
at org.jdesktop.jdic.init.JdicManager.initShareNative(Unknown Source)
at org.jdesktop.jdic.browser.WebBrowser.(Unknown Source)
at org.cz.outulny.musc.client.gui.www.WWWBrowserJXP.initComponents(WWWBrowserJXP.java:195)
at org.cz.outulny.musc.client.gui.www.WWWBrowserJXP.(WWWBrowserJXP.java:51)
at org.cz.outulny.musc.client.gui.www.WWWBrowserJXP.(WWWBrowserJXP.java:35)
at org.cz.outulny.jo.util.ScreenManager.createNewScreen(ScreenManager.java:144)
at org.cz.outulny.jo.util.ScreenManager.createShareScreen(ScreenManager.java:182)
at org.cz.outulny.jo.util.ScreenManager.getShareScreen(ScreenManager.java:199)
at org.cz.outulny.jo.swing.JOLoginPanelJXP.login(JOLoginPanelJXP.java:558)
at org.cz.outulny.jo.swing.JOLoginPanelJXP.passwordJTFKeyPressed(JOLoginPanelJXP.java:326)
at org.cz.outulny.jo.swing.JOLoginPanelJXP.access$200(JOLoginPanelJXP.java:40)
at org.cz.outulny.jo.swing.JOLoginPanelJXP$3.keyPressed(JOLoginPanelJXP.java:133)
at java.awt.Component.processKeyEvent(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission javawebstart.version 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)
... 35 more

JNLP file:

<?xml version="1.0" encoding="UTF-8"?>

JDIC Browser Demo Application
Sun Microsystems, Inc.

JDIC Browser Demo Application
Browser Demo is an example program for web-started JDIC.

-->

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
v_outulny
Offline
Joined: 2007-09-05
Points: 0

Hi
I found solution. You must do this:

this.webBrowser = (WebBrowser) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return new WebBrowser();
}
}
);

More here http://weblogs.java.net/blog/lancea/archive/2007/06/index.html

skchandon
Offline
Joined: 2007-09-12
Points: 0

I am having that same problem only thing is my jdic browser is converted into an JApplet.
when I try to view it thru applet viewer it gives permission error.
any help would be helpful.
thanks

skchandon
Offline
Joined: 2007-09-12
Points: 0

I have found a link of an applet deployment guide.
https://jdic.dev.java.net/documentation/deployment.html

I followed it except I used my own key
but still im getting permission error
here is the code:
----------------------------------

import javax.swing.JApplet;
import javax.swing.*;

import java.io.File;
import java.net.URL;
import java.net.MalformedURLException;

import java.awt.*;
import org.jdesktop.jdic.browser.*;

public class AppletBrowser extends JApplet {
private static final long serialVersionUID = 1L;
public void init() {
WebBrowser.setDebug(true);
WebBrowser browser = new WebBrowser();
URL url;
try {
url = new URL("http://www.google.com");
browser.setURL(url);
} catch (MalformedURLException e) {
e.printStackTrace();
}
this.add(browser);
}
}

----------------------------------

I have unpacked the jdic.jar file and repacked it again with new key (sjdic.jar)..

The Manifest file:
Extension-Name: org.jdic
Specification-Vendor: Sun Microsystems, Inc
Specification-Version: 20060631
Implementation-Vendor-Id: com.sun
Implementation-Vendor: Sun Microsystems, Inc
Implementation-Version: 20060631

i have created jdic_native.jar and signed it with my key (sjdic_native.jar).

The Manifest File:
Extension-Name: org.jdic_native
Specification-Vendor: Sun Microsystems, Inc
Specification-Version: 20060631
Implementation-Vendor-Id: com.sun
Implementation-Vendor: Sun Microsystems, Inc
Implementation-Version: 20060631

I have compiled the above applet using sjdic.jar
Then created a signed jar (stest.jar)..

The Manifest file:

Extension-List: jdic jdic_native
jdic-Extension-Name: org.jdic
jdic-Specification-Version: 20060631
jdic-Implementation-Version: 20060631
jdic-Implementation-Vendor-Id: com.sun
jdic-Implementation-URL: http://localhost/ib/arc/sjdic.jar
jdic_native-Extension-Name: org.jdic_native
jdic_native-Specification-Version: 20060631
jdic_native-Implementation-Version: 20060631
jdic_native-Implementation-Vendor-Id: com.sun
jdic_native-Implementation-URL: http://localhost//ib/arc/sjdic_native.jar

The final HTML code:


Query Output

Output from query
select NAME, PRICE from COFFEES
CODE="AppletBrowser.class"
archive="stest.jar, sjdic.jar, sjdic_native.jar"
WIDTH=250 HEIGHT=200>

Still its not working.
Any help/suggestions appreciated.
Thanks