JNLP "Access Denied" URL

Posted on 2007-04-10
Medium Priority
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 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?

Question by:anthony0007
  • 4
  • 3
LVL 86

Expert Comment

ID: 18884657
Is the server redirecting?

Author Comment

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

Expert Comment

ID: 18884694
Well redirects would be followed OK  by an application. Is that address public so we can test it?
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

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 and the address in the  exception is the same:

java.security.AccessControlException: access denied (java.net.SocketPermission connect,resolve)
LVL 86

Expert Comment

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

Accepted Solution

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

Author Comment

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

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 18 hours left to enroll

850 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