Solved

JNLP "Access Denied" URL

Posted on 2007-04-10
8
419 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
Comment Utility
Is the server redirecting?
0
 

Author Comment

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

Expert Comment

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

Author Comment

by:anthony0007
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
What is the actual jnlp file url?
0
 
LVL 92

Accepted Solution

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

Author Comment

by:anthony0007
Comment Utility
yep, that worked. thanks!
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
>>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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

771 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

10 Experts available now in Live!

Get 1:1 Help Now