World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 09-11-2008, 06:47 PM   #1
jlih
Junior Member
 
Join Date: May 2008
Posts: 9
jlih is on a distinguished road
Unhappy how to solve the access problem

Hi, everyone
I've got a problem in using applet. there will be a problem like this

Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission gov.nasa.worldwind.config.file read)
at java.security.AccessControlContext.check Permission(Unknown Source)
at java.security.AccessController.checkPerm ission(Unknown Source)
at java.lang.SecurityManager.checkPermissio n(Unknown Source)
at java.lang.SecurityManager.checkPropertyA ccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at gov.nasa.worldwind.Configuration.initial izeCustom(Configuration.java:89)
at gov.nasa.worldwind.Configuration.<init>( Configuration.java:46)
at gov.nasa.worldwind.Configuration.<clinit >(Configuration.java:34)
... 13 more

I used to solve it by adding "permission java.security.AllPermission;" in security policy file
Is there any better way to deal with problem?

Thanks in advance
jlih is offline   Reply With Quote
Old 09-11-2008, 07:53 PM   #2
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

Did you sign the jar?
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 09-11-2008, 11:25 PM   #3
jlih
Junior Member
 
Join Date: May 2008
Posts: 9
jlih is on a distinguished road
Default

Quote:
Originally Posted by patmurris View Post
Did you sign the jar?
I signed the applet..
should i change the policy file as well?
thanks
jlih is offline   Reply With Quote
Old 12-04-2008, 05:35 AM   #4
bianconera
Junior Member
 
Join Date: Nov 2008
Posts: 17
bianconera is on a distinguished road
Default

I would like to push this thread up as I ran into a very similiar problem as jlih had. By the way, jlih have you got any solution to it?

I am developing an applet which will hopefully enable the user to overlay any OGC WMS on WWJ by simply passing its URL via an input dialogue box. At the moment, I've developed a class that takes in an input URL and generates a number of WMSTiledImageLayer objects depending on how many layers that a WMS service contains. WWJ then adds and display those generated WMSTiledImageLayer on the globe.

I tried it with both application and applet. It turned out successful on the application but failed the applet. Here is what I got in the Java Console.

Code:
java.security.AccessControlException: access denied (java.net.SocketPermission www2.demis.nl:80 connect,resolve)
	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.checkConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at geo.wwj.layers.wms.OGCWMSFactory.createWMSConnection(Unknown Source)
	at geo.wwj.applet.WWJApplet.connectToWMS(Unknown Source)
	at geo.wwj.applet.WWJApplet.drawMBR(Unknown Source)
	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 sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
	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 sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
	at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
	at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
	at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
java.lang.NullPointerException
	at geo.wwj.applet.WWJApplet.connectToWMS(Unknown Source)
	at geo.wwj.applet.WWJApplet.drawMBR(Unknown Source)
	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 sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
	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 sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
	at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
	at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
	at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
java.lang.Exception: java.lang.NullPointerException
	at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
	at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
Obviously, the applet failed to connect to the WMS server and retrieve Capabilities xml. Interestingly, it worked out fine on the application.

Then I tried to make a new WMS layer class and point the serviceUrl to this WMS service, and added the layer to the properties file. The applet loaded up the layer and got the image overlayed on the globe.

I know there is strict network connection restrictions imposed on unsigned applets, but mine is a signed one.

Could anybody give me a clue how the WWJ Applet example manages to load WMS services written in the properties file with no network connection restriction issue?

Thanks in advance!
bianconera is offline   Reply With Quote
Old 12-05-2008, 03:05 AM
Chiss
This message has been deleted by Chiss. Reason: Did't read the message completely...sorry!
Old 04-01-2009, 06:32 PM   #5
WindRider
Member
 
Join Date: Feb 2009
Posts: 46
WindRider is on a distinguished road
Default

I've got something similar in my Web Start application:

Code:
java.lang.ExceptionInInitializerError
	at com.buildware.navigator.FlightNavigator.<clinit>(FlightNavigator.java:382)
	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.security.AccessControlException: access denied (java.util.PropertyPermission gov.nasa.worldwind.config.file 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 gov.nasa.worldwind.Configuration.initializeCustom(Unknown Source)
	at gov.nasa.worldwind.Configuration.<init>(Unknown Source)
	at gov.nasa.worldwind.Configuration.<clinit>(Unknown Source)
	... 10 more
My JAR is signed. The line 382 where crash happens is:

Code:
static
    {
        if (Configuration.isMacOS())
...
    }
The JNLP has <all-permissions/> security. I've checked if worldwind.jar is signed and it surely is. Do you know why happens this?
WindRider is offline   Reply With Quote
Old 04-01-2009, 11:15 PM   #6
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

bianconera: did you confirm this issue on different computers and/or on different networks? Is there any javascripting involved at applet startup?

both: can you post your html/xml applet/jnlp code? Thanks.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 04-02-2009, 12:18 AM   #7
WindRider
Member
 
Join Date: Feb 2009
Posts: 46
WindRider is on a distinguished road
Default

Sorry, I deleted <all-permissions/> by accident. The problem is fixed, but now I have different problem. I get an error "JAR resources in JNLP file are signed by different certificates". I've signed worldwind.jar with the same keystore as my JAR. Here is the resources section:

Code:
<resources>
	<j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" initial-heap-size="512m" max-heap-size="512m"/>	
	<property name="sun.java2d.noddraw" value="true"/>
	<extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"/>
	<jar href="gpsinput-0.5.3.jar"/>
	<jar href="gpstool-0.5.3.jar"/>	
	<jar href="worldwind.jar"/>	
        <jar href="FlightNavigator.jar" main="true"/>
    </resources>
How to find out which is the differently signed JAR? Maybe the JOGL JAR files? Please, help!
WindRider is offline   Reply With Quote
Old 04-02-2009, 03:16 PM   #8
WindRider
Member
 
Join Date: Feb 2009
Posts: 46
WindRider is on a distinguished road
Default

I have put the worldwind.jar ver.0.6.61.9736 in the same directory. It is signed by NASA. Then I signed it twice with my keys. Is this could be the problem?
WindRider is offline   Reply With Quote
Old 04-03-2009, 12:21 AM   #9
WindRider
Member
 
Join Date: Feb 2009
Posts: 46
WindRider is on a distinguished road
Default

Yes, this caused the problem. I compiled WW into a new jar, which is unsigned as you know. Then signed it with my key and voila!
WindRider is offline   Reply With Quote
Old 04-03-2009, 01:27 AM   #10
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

Thanks for the feedback WindRider
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem connecting to server wait 2 min mikl Technical Support 3 01-11-2010 07:44 AM
Problem in Calling Selected Event to Identify Prism Object turbo2000r Development Help 7 08-31-2008 07:19 PM
applet security problem with WWJ v0.5 ? jp09 Development Help 3 05-20-2008 03:04 PM
Viewing problem, picture still fuzzy Unregistered Install Support 1 09-04-2006 11:05 AM
Problem in texture or terrain visualization gabrio Technical Support 5 05-27-2006 01:34 AM


All times are GMT +1. The time now is 06:34 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.