Java Web Start with signature

Everything,

I'm having trouble starting the Java Web Start application that Netbeans 7 created.

I migrated an existing java 6.9.1 application to Netbeans 7 and tried to make it a web start application.

To do this, I checked the Enable Web Launch option from the project properties.

For the codebase parameter, I have chosen to deploy web applications. An application descriptor is selected that will point the JNLP descriptor application element to the main application class.

For signing, I generated a key and pointed to this Signing property. I have mixed code configured for Trusted Only, since my application will only use signed JARs.

When I compile, all the specified JAR files and the application JAR file are signed, which are displayed in the console (for each of them) as follows:

Signing JAR: D:\MyCode\dist\lib\somejarfile.jar to D:\MyCode\dist\lib\somejarfile.jar as signFiles Enter Passphrase for keystore: Enter key password for signFiles: 

NOTE. signFiles is the alias I used in the signature properties in Netbeans.

The following files are created in my dist folder:

  • Lib
  • jnlpcomponent1.jnlp
  • launch.html
  • launch.jnlp
  • README.TXT
  • My app.jar

I copied them to my web folder located under tomcat, which is C: \ Program Files \ Apache Software Foundation \ Tomcat 7.0 \ webapps \ mywebapp.

I start from the following URL in IE and Firefox: http: // mylaptop: 8080 / mywebapp / launch.html

The following exception is thrown when you click a button in the launch.html file to launch the JNLP file:

 com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/panderson/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/B3UCQV8C/$$codebase/launch.jnlp 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.deploy.net.DownloadEngine.getResource(Unknown Source) at com.sun.javaws.Launcher.updateFinalLaunchDesc(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) 

My launch.jnlp file has the following:

 <jnlp codebase="$$codebase" href="launch.jnlp" spec="1.0+"> ... <resources> <j2se version="1.6+"/> <jar href="My App.jar" main="true"/> ... 

I'm not too sure why he is looking under temporary folders in Internet Explorer for him ...

... But I tried to put the full url in jnlp href in the startup file .JNLP http: // mylaptop: 8080 / mywebapp / launch.jnlp , after which it throws the following exception:

 com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/C:/Users/panderson/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/DR2O6URQ/$$codebase/My App.jar 

If I then changed the jar href to http: // mylaptop: 8080 / mywebapp / My App.jar, the following exception is thrown when I click the .html button in launch to launch launch.JNLP file.

 BadFieldException[ The field <jnlp>codebase has an invalid value: $$codebase,$$codebase] 

Any help or thoughts?

Greetings

Andez

+4
source share
2 answers
 <jnlp codebase="$$codebase" href="launch.jnlp" spec="1.0+"> 

These $$ place-holder values ​​are usually translated to something reasonable using a servlet or similar functionality.

+3
source

This has been suggested as a useful tool in the following question .

Try using JaNeLA and see if any problems are found with your JNLP file.

Further double check and make sure the codebase url matches the url of your server / application.

+2
source

All Articles