Skip to main content

Problem with NavigatorView when launching Help from Webstart enabled application

1 reply [Last post]
Anonymous

Hi,

We currently face a problem when using JavaHelp (2.0) in a Webstart enabled
application: the navigator view remains empty, i.e. only the content view is
shown. No exception is thrown or anything else. When running 'locally' (in
JRE) everything works fine.

The helpset and toc etc. is placed in a single JAR which is extracted to
local file system (when the app launches) and accessed via file:/-URL. We're
using code from the JHLauncher demo and are testing with demo help-JARs
(just to make sure it is not related to our helpset). While debugging we
found following difference:

1) Code run locally in Eclipse/JRE:

hsName=Animals.hs
HelpsetURL=jar:file:/E:/software/development/java/help/jh2.0/demos/hsjar/ani
mals.jar!/Animals.hs
HelpsetLoader=java.net.URLClassLoader@2e7263
views:
javax.help.TOCView@1cf8583
javax.help.IndexView@5ffb18
javax.help.SearchView@7b7072
showHelp
helpBroker.CurrentView:TOC

-- JWS:
2) Code run in Webstart application:

hsName=Animals.hs
HelpsetURL=jar:file:/E:/software/development/java/help/jh2.0/demos/hsjar/ani
mals.jar!/Animals.hs
HelpsetLoader=java.net.URLClassLoader@15b28d8
views: []
showHelp

So the local help jar is located and loaded via URLClassLoader. Helpset and
HelpBroke is created. However the NavigatorView[] array is empty
(helpset.getNavigatorViews()) - furthermore a call to
helpBroker.getCurrentView() leads to an
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
javax.help.WindowPresentation.getCurrentView(WindowPresentation.java:223)
at
javax.help.DefaultHelpBroker.getCurrentView(DefaultHelpBroker.java:159)

Already read a bunch a postings related to Webstart and JavaHelp but couldnt
find a hint. The JavaHelp (jh.jar) is included in the webstart deployment.
The main help window also shows up in the application but *not* the
TOC/search view. I know this may also be more Webstart related but thought
that anyone here may have encountered this problem bevore or has some hints
on where to look further... Thanks in advance!

Kind regards

Thomas Koch
--
OrbiTeam Software GmbH & Co. KG
http://www.orbiteam.de

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

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.
Thomas Koch

If anyone is interested: I meanwhile found a fix/workaround.

You need to delegate to javawebstart classloader before creating the
URLClassLoader (otherwise jhelp components cannot be loaded and TOC is not
shown).

ClassLoader wcl = Main.class.getClassLoader();
URL x[] = parseURLs(hsPath);
loader = new URLClassLoader(x,wcl);
URL url = HelpSet.findHelpSet(loader, hsName);
...
see http://lopica.sourceforge.net/faq.html

Where Main is the Main class of the JWS application.

regards
Thomas Koch
--
OrbiTeam Software GmbH & Co. KG
http://www.orbiteam.de

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

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.