2009-08-11 15 views
2

C'est la première fois que j'essaie d'utiliser Web Start, et j'essaie de lancer mon pot runnable. J'obtiens l'erreur suivante de ma page Web pendant que je clique sur le lien pour lancer le pot. Quelqu'un peut m'aider? L'exemple Notepad du tutoriel fonctionne bien à partir d'un autre lien sur la page de test (JNLP et JAR dans le même dossier que j'ai aussi). Le pot et jnlp sont définitivement dans le même dossier, mais le pot ne peut pas être trouvé. Merci d'avance.Lancez Runnable Jar à partir de Web Start

Structure des dossiers:

/MyApp 
/MyApp/MyApp.jnlp 
/MyApp/MyApp.jar 

JNLP fichier:

<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="1.0+" codebase="http://localhost/MyApp" href="MyApp.jnlp"> 
    <information> 
     <title>MyApp Demo</title> 
     <vendor>Company Name</vendor> 
    </information> 
    <resources>  
    <jar href="MyApp.jar"/> 
    <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/> 
    </resources> 
    <application-desc main-class="MyAppMain"> 
    <argument>arg1</argument> 
    <argument>arg2</argument> 
    </application-desc> 
</jnlp> 

Exception:

com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://localhost/MyApp/MyApp.jar 
    at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source) 
    at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source) 
    at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source) 
    at com.sun.javaws.Launcher.downloadResources(Unknown Source) 
    at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.launch(Unknown Source) 
    at com.sun.javaws.Main.launchApp(Unknown Source) 
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source) 
    at com.sun.javaws.Main$1.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 

Exception Enveloppé:

java.io.FileNotFoundException: http://localhost/MyApp/MyApp.jar 
    at sun.reflect.GeneratedConstructorAccessor2.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source) 
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source) 
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source) 
    at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source) 
    at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source) 
    at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source) 
    at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source) 
    at com.sun.javaws.Launcher.downloadResources(Unknown Source) 
    at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) 
    at com.sun.javaws.Launcher.launch(Unknown Source) 
    at com.sun.javaws.Main.launchApp(Unknown Source) 
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source) 
    at com.sun.javaws.Main$1.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.io.FileNotFoundException: http://localhost/MyApp/MyApp.jar 
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) 
    at java.net.HttpURLConnection.getResponseCode(Unknown Source) 
    ... 20 more 

Console:

Java Web Start 1.6.0_15 
Using JRE version 1.6.0_15-b03 Java HotSpot(TM) Client VM 
User home directory = C:\Documents and Settings\username 
---------------------------------------------------- 
c: clear console window 
f: finalize objects on finalization queue 
g: garbage collect 
h: display this help message 
m: print memory usage 
o: trigger logging 
p: reload proxy configuration 
q: hide console 
r: reload policy configuration 
s: dump system and deployment properties 
t: dump thread list 
v: dump thread stack 
0-5: set trace level to <n> 
---------------------------------------------------- 
#### Java Web Start Error: 
#### Unable to load resource: http://localhost/MyApp/MyApp.jar 

Répondre

2

J'ai trouvé mon Reson pourquoi ce fichier ne se charge pas. C'était une erreur d'autorisation. Le compte qui tente d'accéder au fichier JAR n'a pas d'autorisations Windows. J'ai créé le fichier JAR à partir d'Eclipse et l'ai exporté sur mon bureau, puis copié dans le répertoire JNLP. Ces autorisations n'ont pas été modifiées pour le fichier JAR après le copier/coller.