Solved

JNLP "Access Denied" URL

Posted on 2007-04-10
8
426 Views
Last Modified: 2008-01-09
I have a java app that makes a connection to a webserver. It requests a .jar file that contains 1 file.  The URL is as follows: jar://myserver/test.jar!/fact_list.txt . This works fine when it is run as an application. HOwever, when I try to run it as a .jnlp file I encounter a error:
java.security.AccessControlException: access denied (java.net.SocketPermission 199.43.2.201:8080 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 sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
      at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
      at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
      at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
      at sun.net.www.protocol.jar.JarURLConnection.getInputStream(Unknown Source)
      at fdw.EditorLookUpSettings.loadVendors(EditorLookUpSettings.java:28)
      at fdw.DefineRatio.<init>(DefineRatio.java:24)
      at visualcomponents.FDW_Application.main(FDW_Application.java:14)
      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.continueLaunch(Unknown Source)
      at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
      at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
      at com.sun.javaws.Launcher.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

I have not signed the .jar file that contains my application. I didn't think I needed to sign it because it is trying to access the same server from which it was downloaded. Any ideas on what I am missing?

Anthony
0
Comment
Question by:anthony0007
  • 4
  • 3
8 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 18884657
Is the server redirecting?
0
 

Author Comment

by:anthony0007
ID: 18884670
No, it works fine when I run it as an application.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18884694
Well redirects would be followed OK  by an application. Is that address public so we can test it?
0
 

Author Comment

by:anthony0007
ID: 18884894
Sorry, its not. I will need to see my administrator to find a public server. However, I don't think it is a redirecting issue. I notice that the address I am accessing is http://199.43.2.201:8080/fdw/test.html and the address in the  exception is the same:

java.security.AccessControlException: access denied (java.net.SocketPermission 199.43.2.201:8080 connect,resolve)
0
Will my email signature work in Office 365?

You've built an email signature using raw HTML code in Office 365, but you can't review how it looks with Transport Rules. So you have to test it over and over again before it can be used. Isn't this a bit of a waste of your time? Wouldn't a WYSIWYG editor make it a lot easier?

 
LVL 86

Expert Comment

by:CEHJ
ID: 18884942
What is the actual jnlp file url?
0
 
LVL 92

Accepted Solution

by:
objects earned 125 total points
ID: 18885742
try changing the url to use the same hostname and port as the jnlp was loaded with.
0
 

Author Comment

by:anthony0007
ID: 18900862
yep, that worked. thanks!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18902151
>>yep, that worked. thanks!

I thought you said you were already doing that? (see below)

>>because it is trying to access the same server from which it was downloaded
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now