Hi people,
I seem to have encountered a problem using Web Start after updrading my JRE from 1.5.0_15 to 1.5.0_16.
I have written a simple test program as shown below. This simply tries to load a java-help HelpSet file.
import java.net.URL;
import javax.help.HelpSet;
import javax.help.HelpSetException;
public class HelpTest {
public HelpTest() {
final ClassLoader cl = HelpTest.this.getClass().getClassLoader();
System.out.println("classloader = " + cl);
final URL url = HelpSet.findHelpSet(cl, "jhelpset.hs");
System.out.println("url = " + url);
try {
final HelpSet hs = new HelpSet(cl, url);
System.out.println("helpset = " + hs);
} catch (final HelpSetException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new HelpTest();
}
}
The following is the JNLP file
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for Help Test -->
<jnlp spec="1.0+" codebase="http://localhost:8080/helptest/" href="helptest.jnlp">
<information>
<title>Help Test Demo</title>
<vendor>My Own Vendor</vendor>
<description>Help Test</description>
<homepage href="http://www.google.co.uk"/>
<description kind="short">Test loading of help</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="helptest.jar"/>
<jar href="helpfiles.jar"/>
<extension href="http://localhost:8080/helptest/javahelp.jnlp" name="javahelp"/>
<j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
</resources>
<application-desc main-class="com.snh.HelpApp.HelpTest"/>
</jnlp>
This is my JNLP file for the java-help
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/helptest/" href="javahelp.jnlp">
<information>
<title>JavaHelp</title>
<vendor>Sun Microsystems, Inc.</vendor>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="javahelp-2_0_05.jar"/>
</resources>
<component-desc/>
</jnlp>
The follwing jars, which are all signed, are contained in my WAR file.
helptest.jar (This just contains the class show above plus the files in the META-INF directory)
helpfiles.jar (This just contains 3 files jhelpset.hs, jhelpmap.jhm, jhelptoc.xml plus the files in the META-INF directory)
javahelp-2_0_05.jar (Java Help, This was already signed by SUN)
If the application is run through JRE 1.5.0._15 I get the following output on the Java Console:-
Java Web Start 1.5.0_15
Using JRE version 1.5.0_15 Java HotSpot(TM) Client VM
User home directory = I:\Documents and Settings
----------------------------------------------------
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
0-5: set trace level to <n>
----------------------------------------------------
classloader = com.sun.jnlp.JNLPClassLoader@29428e
url = jar:file:I:/Documents%20and%20Settings/Application%20Data/Sun/Java/Deployment/cache/javaws/http/Dlocalhost/P8080/DMhelptest/java-XMhelpfiles.jar43748tmp!/jhelpset.hs
helpset = Help Test User Guide
If I then install JRE 1.5.0_16 and run the application I get the following error message on the Java Console:-
Java Web Start 1.5.0_16
Using JRE version 1.5.0_16 Java HotSpot(TM) Client VM
User home directory = I:\Documents and Settings
----------------------------------------------------
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
0-5: set trace level to <n>
----------------------------------------------------
classloader = com.sun.jnlp.JNLPClassLoader@29428e
url = jar:jhelpset.hs
javax.help.HelpSetException: Could not parse
Malformed URL: jhelpmap.jhm.
Parsing failed for jar:jhelpset.hs
at javax.help.HelpSet.<init>(HelpSet.java:154)
at com.snh.HelpApp.HelpTest.<init>(HelpTest.java:24)
at com.snh.HelpApp.HelpTest.main(HelpTest.java:36)
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 noticed that somehow the URL in 1.5.0_15 was picking up the directory that Web Start uses
for its cache which then loads the HelpSet correctly.
However the URL that 1.5.0_16 picks up seems to be incomplete/incorrect.
Does anyone have any ideas as to why this error message is suddenly being produced?
Any light shed on this would be much appreciated.
Thanks,
Steve.
Edited by: scoobysteve on Jul 26, 2008 12:57 PM