Skip to main content

HelpSet displays HTML in raw form when using a custom class loader

2 replies [Last post]
Anonymous

Hi.

I'm trying to diagnose a customer's problem which I have reproduced myself.

A GlassFish application client uses JavaHelp. The jh.jar and the
example ide help jar are packaged with the application, which means that
a custom class loader provided by GlassFish resolves the request for the
help set JAR and the .hs file within it. The help system finds the JAR
and the .hs entry just fine, but the HTML is displayed in raw form (with
the tags visible).

If instead I include the idehelp.jar in the system class path
(essentially using -classpath path/to/idehelp.jar on the java command)
then the help text is displayed correctly, presumably because our custom
class loader (which follows the conventional delegation model) defers to
its parent to find the idehelp.jar.

Also, the custom class loader is required to provide its own type of
InputStream when resources are opened.

Is there a way JavaHelp's behavior will vary depending on which class
loader or which implementation of InputStream is used to access the
.hs? I assume that this may be due to the equivalent of a JEditorPane
being set to a content type other than text/html, perhaps due to a
difference in which editor kit is used??

How can I further diagnose this to find out if this is a problem in
JavaHelp or in something we're doing?

Thanks.

- Tim

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

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.
Roger Brinkley

Tim Quinn wrote:
> Hi.
>
> I'm trying to diagnose a customer's problem which I have reproduced
> myself.
>
> A GlassFish application client uses JavaHelp. The jh.jar and the
> example ide help jar are packaged with the application, which means
> that a custom class loader provided by GlassFish resolves the request
> for the help set JAR and the .hs file within it. The help system
> finds the JAR and the .hs entry just fine, but the HTML is displayed
> in raw form (with the tags visible).
>
> If instead I include the idehelp.jar in the system class path
> (essentially using -classpath path/to/idehelp.jar on the java command)
> then the help text is displayed correctly, presumably because our
> custom class loader (which follows the conventional delegation model)
> defers to its parent to find the idehelp.jar.
> Also, the custom class loader is required to provide its own type of
> InputStream when resources are opened.
>
> Is there a way JavaHelp's behavior will vary depending on which class
> loader or which implementation of InputStream is used to access the
> .hs? I assume that this may be due to the equivalent of a JEditorPane
> being set to a content type other than text/html, perhaps due to a
> difference in which editor kit is used??
>
> How can I further diagnose this to find out if this is a problem in
> JavaHelp or in something we're doing?
>

JavaHelp behavior shouldn't vary depending on the class loader. One
thing you could do is compile the open sourced version of javahelp. At
least that way you could get some debugging information.

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.

Tim Quinn

I found out the underlying cause and I've described it in detail in this
GlassFish issue

https://glassfish.dev.java.net/issues/show_bug.cgi?id=5222

where people can read the gory details if interested. I am not aware of
other occurrences of this problem that involve GlassFish, but this
problem is not constrained to GlassFish.

- Tim

Roger Brinkley wrote:
> Tim Quinn wrote:
>> Hi.
>>
>> I'm trying to diagnose a customer's problem which I have reproduced
>> myself.
>>
>> A GlassFish application client uses JavaHelp. The jh.jar and the
>> example ide help jar are packaged with the application, which means
>> that a custom class loader provided by GlassFish resolves the request
>> for the help set JAR and the .hs file within it. The help system
>> finds the JAR and the .hs entry just fine, but the HTML is displayed
>> in raw form (with the tags visible).
>>
>> If instead I include the idehelp.jar in the system class path
>> (essentially using -classpath path/to/idehelp.jar on the java
>> command) then the help text is displayed correctly, presumably
>> because our custom class loader (which follows the conventional
>> delegation model) defers to its parent to find the idehelp.jar.
>> Also, the custom class loader is required to provide its own type of
>> InputStream when resources are opened.
>>
>> Is there a way JavaHelp's behavior will vary depending on which class
>> loader or which implementation of InputStream is used to access the
>> .hs? I assume that this may be due to the equivalent of a
>> JEditorPane being set to a content type other than text/html, perhaps
>> due to a difference in which editor kit is used??
>>
>> How can I further diagnose this to find out if this is a problem in
>> JavaHelp or in something we're doing?
>>
>
> JavaHelp behavior shouldn't vary depending on the class loader. One
> thing you could do is compile the open sourced version of javahelp. At
> least that way you could get some debugging information.
>
> 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.