Skip to main content

Re: Why might JRE 1.5 break my help ?

5 replies [Last post]
Anonymous

Hey Paul, I know this is way late for your post but I just ran into the same
problem and was able to find out what was happening.

We use 'java.io.File.separator' to construct a String path to the .hs file
and pass that to HelpSet.findHelpSet(), like this:

private static final String SLASH = java.io.File.separator;
...
StringBuffer path = new StringBuffer("doc").append(SLASH)....

We then rely on HelpSet.findHelpSet() to build the URL.

Well in 1.4.2_09, the URL is peachy: hsURL: file:/C:/Program%
20Files/SAS/SASInformationMapStudio/3.1/doc/en/imc/config/imc.hs

But in 1.5.0_01, the URL has some encoded values: hsURL: file:/C:/Program%
20Files/SAS/SASInformationMapStudio/3.1/doc%5cen%5cimc%5cconfig%5cimc.hs

The encoded values seem to be causing problems for methods such as
HelpSet.getLocalMap(). The help just bombs.

But after changing to '/' for the separators, everything is fine in both
JDK's.

On Thu, 24 Mar 2005 18:09:40 -0800, Paul Campbell
wrote:

>{ This must be an FAQ but I couldn't find it. }
>
>I have been running JavaHelp for well over a year,
>JavaHelp 2 from Oct 04 currently,
>but now that I got the customer to switch to
>java SE 1.5, and JavaHelp fails on windows.
>
>It seems to be a path issue.
>
>All of my help files(html, xml, jhm) are in a directory help
>and in my jhm
>
>
>
>
>
>
>I jar up my class files and then zip up the whole project
>and the user downloads/unzips the whole 28MB and
>double clicks the jar to run.
>
>But now, just before a demo next week, it starts failing
>and I had pushed the customer to move to 1.5. I still works on 1.4.
>
>What happened ?
>
>Is there an easy fix ?
>
>I sure hope I don't need to patch my code to handle
>file naming differences between windows, linux and versions
>of jre.
>
>***************************************************************************
*****

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Geoff Hall

This might be the clue to my dilemma.

After I built and installed my product, it failed to find and load the helpset
file on startup.

I used:
URL url = ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");
to get the URL of the .hs file, then
helpSet = new HelpSet(ClassLoader.getSystemClassLoader(), url);
to create the helpset.

The URL that comes back, however, is
file:/U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs
which seems to have been OK in 1.4.2, but not in 1.5

Shouldn't this URL, though, have been
file:///U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs
(extra slashes after 'file:') to be strictly correct?

Might this be "the problem behind the problem?"

Regards,
Geoff Hall
Gemcom Software

-----Original Message-----
From: Discussion list of JavaHelp [mailto:JAVAHELP-INTEREST@JAVA.SUN.COM] On
Behalf Of David Cagle
Sent: 18 March 2006 07:23
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Why might JRE 1.5 break my help ?

Hey Paul, I know this is way late for your post but I just ran into the same
problem and was able to find out what was happening.

We use 'java.io.File.separator' to construct a String path to the .hs file
and pass that to HelpSet.findHelpSet(), like this:

private static final String SLASH = java.io.File.separator;
...
StringBuffer path = new StringBuffer("doc").append(SLASH)....

We then rely on HelpSet.findHelpSet() to build the URL.

Well in 1.4.2_09, the URL is peachy: hsURL: file:/C:/Program%
20Files/SAS/SASInformationMapStudio/3.1/doc/en/imc/config/imc.hs

But in 1.5.0_01, the URL has some encoded values: hsURL: file:/C:/Program%
20Files/SAS/SASInformationMapStudio/3.1/doc%5cen%5cimc%5cconfig%5cimc.hs

The encoded values seem to be causing problems for methods such as
HelpSet.getLocalMap(). The help just bombs.

But after changing to '/' for the separators, everything is fine in both
JDK's.

On Thu, 24 Mar 2005 18:09:40 -0800, Paul Campbell
wrote:

>{ This must be an FAQ but I couldn't find it. }
>
>I have been running JavaHelp for well over a year,
>JavaHelp 2 from Oct 04 currently,
>but now that I got the customer to switch to
>java SE 1.5, and JavaHelp fails on windows.
>
>It seems to be a path issue.
>
>All of my help files(html, xml, jhm) are in a directory help
>and in my jhm
>

>
>
>

>
>
>I jar up my class files and then zip up the whole project
>and the user downloads/unzips the whole 28MB and
>double clicks the jar to run.
>
>But now, just before a demo next week, it starts failing
>and I had pushed the customer to move to 1.5. I still works on 1.4.
>
>What happened ?
>
>Is there an easy fix ?
>
>I sure hope I don't need to patch my code to handle
>file naming differences between windows, linux and versions
>of jre.
>
>***************************************************************************
*****

*******************************************************************************
*

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Roger Brinkley

Geoff Hall wrote:
> This might be the clue to my dilemma.
>
> After I built and installed my product, it failed to find and load the helpset
> file on startup.
>
> I used:
> URL url = ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");
> to get the URL of the .hs file, then
> helpSet = new HelpSet(ClassLoader.getSystemClassLoader(), url);
> to create the helpset.
>
> The URL that comes back, however, is
> file:/U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs
> which seems to have been OK in 1.4.2, but not in 1.5
>
> Shouldn't this URL, though, have been
> file:///U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs
> (extra slashes after 'file:') to be strictly correct?

Looking at the URL constructed in hsviewer the URL spec should be
someting like:

file:C:\jh2.0\demos\hsjar\holidays.jar

Remember that URLs should have a "\" as separator instead of the MS "/".
Most likely that is more of the problem.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Geoff Hall

Hi Binky,

Then I'm even more confused!

My original request to get the helpset url didn't have any slashes, i.e.
URL url = ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");

I'm running Sun Java 1.5.0_06 on a Win XP (fully patched) system with JavaHelp
2.0_02, so you see, I had nothing to do with the slashes, they were all put
there by Sun's products. I had assumed they were doing it right, but since I
haven't yet had a successful run from a build & install with 1.5, I'm beginning
to wonder.

At first I thought it was something I'd done (apart from J 1.5 - it might still
be) but David Cagle gave me a clue that it might not be me. I'll go back to
1.4 to check that out, but if you know why 1.5 might be causing the problem,
I'd appreciate feedback on that too!

Cheers,
Geoff

-----Original Message-----
From: Discussion list of JavaHelp [mailto:JAVAHELP-INTEREST@JAVA.SUN.COM] On
Behalf Of Roger Brinkley
Sent: 21 March 2006 05:00
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Why might JRE 1.5 break my help ?

Geoff Hall wrote:
> This might be the clue to my dilemma.
>
> After I built and installed my product, it failed to find and load the
helpset
> file on startup.
>
> I used:
> URL url =
ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");
> to get the URL of the .hs file, then
> helpSet = new HelpSet(ClassLoader.getSystemClassLoader(), url);
> to create the helpset.
>
> The URL that comes back, however, is
> file:/U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs
> which seems to have been OK in 1.4.2, but not in 1.5
>
> Shouldn't this URL, though, have been
> file:///U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs
> (extra slashes after 'file:') to be strictly correct?

Looking at the URL constructed in hsviewer the URL spec should be
someting like:

file:C:\jh2.0\demos\hsjar\holidays.jar

Remember that URLs should have a "\" as separator instead of the MS "/".
Most likely that is more of the problem.

Binky

*******************************************************************************
*

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Roger Brinkley

Geoff Hall wrote:
> Hi Binky,
>
> Then I'm even more confused!
>
> My original request to get the helpset url didn't have any slashes, i.e.
> URL url = ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");
>
> I'm running Sun Java 1.5.0_06 on a Win XP (fully patched) system with JavaHelp
> 2.0_02, so you see, I had nothing to do with the slashes, they were all put
> there by Sun's products. I had assumed they were doing it right, but since I
> haven't yet had a successful run from a build & install with 1.5, I'm beginning
> to wonder.
>
> At first I thought it was something I'd done (apart from J 1.5 - it might still
> be) but David Cagle gave me a clue that it might not be me. I'll go back to
> 1.4 to check that out, but if you know why 1.5 might be causing the problem,
> I'd appreciate feedback on that too!
>

Run hsviewer and select the helpset. See what the file spec says.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Geoff Hall

When I run hsviewer and use the browse dialog, I eventually end up with the
"Set HelpSet..." window saying:
[HelpSet Name] fxpeHelp.hs
[HelpSet URL:] file:U:\JavaDev\whittle\FXPE\HelpSource\
and that successfully starts the help in standalone mode. I also use a BAT
file with:
FX/CVF T:\FX\Test\Demo>C:\Progra~1\Java\jre1.5.0_06\bin\java.exe -jar
U:\jh2.0_02\demos\bin\hsviewer.jar -helpset
U:\JavaDev\whittle\FXPE\HelpSource\fxpeHelp.hs
(all on one line) which does the same thing.

When I display the helpset file in a browser (Netscape) it insists on:
file:///U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs

Neither of those necessarily help me when I'm trying to display it inside Java
using the
URL url = ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");
helpSet = new HelpSet(ClassLoader.getSystemClassLoader(), url);
helpBroker = helpSet.createHelpBroker();
...etc...
mechanism, which has been working quite successfully up until now.

Inside the url object, the "file" attribute is defined as
/U:/JavaDev/whittle/FXPE/HelpSource/fxpeHelp.hs (as you said in our earlier
exchanges).

It works when I run it in JBuilder (using the Sun 1.5.0_06 JDK), but not when I
build it as a standalone product (where it is running with Sun JRE 1.5.0_06).
I won't be absolutely convinced it's a problem with J 1.5 until I've rebuilt
the product back in 1.4.2, but the evidence seems to point that way at present.

The 1.4.2 build is one of my tasks for today :)

Geoff

-----Original Message-----
From: Discussion list of JavaHelp [mailto:JAVAHELP-INTEREST@JAVA.SUN.COM] On
Behalf Of Roger Brinkley
Sent: 21 March 2006 08:32
To: JAVAHELP-INTEREST@JAVA.SUN.COM
Subject: Re: [JAVAHELP] Why might JRE 1.5 break my help ?

Geoff Hall wrote:
> Hi Binky,
>
> Then I'm even more confused!
>
> My original request to get the helpset url didn't have any slashes, i.e.
> URL url = ClassLoader.getSystemClassLoader().getResource("fxpeHelp.hs");
>
> I'm running Sun Java 1.5.0_06 on a Win XP (fully patched) system with
JavaHelp
> 2.0_02, so you see, I had nothing to do with the slashes, they were all put
> there by Sun's products. I had assumed they were doing it right, but since I
> haven't yet had a successful run from a build & install with 1.5, I'm
beginning
> to wonder.
>
> At first I thought it was something I'd done (apart from J 1.5 - it might
still
> be) but David Cagle gave me a clue that it might not be me. I'll go back to
> 1.4 to check that out, but if you know why 1.5 might be causing the problem,
> I'd appreciate feedback on that too!
>

Run hsviewer and select the helpset. See what the file spec says.

Binky

*******************************************************************************
*

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.