Skip to main content

Malformed URL exception using Web Start after upgrading to JRE 1.5.0_16

4 replies [Last post]
scoobysteve
Offline
Joined: 2003-09-15
Points: 0

Hi people,

I seem to have encountered a problem using Web Start after upgrading 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();
}
}

(NOTE: I have also used Thread.currentThread().getContextClassLoader() to retrieve the classloader but I get the same result).

The following is the JNLP file

<?xml version="1.0" encoding="utf-8"?>

Help Test Demo
My Own Vendor

Help Test
Test loading of help

This is my JNLP file for the java-help

<?xml version="1.0" encoding="utf-8"?>

JavaHelp
Sun Microsystems, Inc.

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
----------------------------------------------------
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
----------------------------------------------------
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.(HelpSet.java:154)
at com.snh.HelpApp.HelpTest.(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.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
webmasterpete
Offline
Joined: 2005-08-16
Points: 0

We are also having a problem with JavaHelp on OS X with the 1.5.0_16 revision -
Have you reported the Bug? I looked for a place to report bugs with Apple but couldn't find anything - maybe I didn't look hard enough. I hope Apple fixes this - I don't want to make changes to our application just so it can run on OS X!

leifneve
Offline
Joined: 2007-11-07
Points: 0

Does anyone have a workaround for this? We are encountering the same problem on Mac OS X and unfortunately Apple doesn't offer an easy way to roll back its JRE to 1.5.0_15. And Java 6 is only available for 64-bit computers currently. Thanks.

ecki
Offline
Joined: 2003-06-15
Points: 0

This seems to be a 1.5.0_16 Regression. We see the same here. And not only with Helpsets but also with a EntityResolver of Xerces.

My guess is that the URL parser got more strict in order to prevent some exploits related with this sun Alert: (the URL contains the jar: and ! symbols).

http://sunsolve.sun.com/search/document.do?assetkey=1-66-238628-1

However the Bugs are not public, so it is hard to say. I guess I will file a bug about this.

ecki
Offline
Joined: 2003-06-15
Points: 0