?
Solved

JNLP "Access Denied" URL

Posted on 2007-04-10
8
Medium Priority
?
467 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 

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
 
LVL 86

Expert Comment

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

Accepted Solution

by:
objects earned 500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
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 Month11 days, 11 hours left to enroll

752 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