Skip to main content

[JAVAHELP] Search, jhindexer, and jar files

13 replies [Last post]
Anonymous

Hi all,

I am having difficulties using the search function of javahelp inside a
jar file. Unjarred, the help set and search functionality work just
fine. However, when the files are jarred, I can see the helpset but when
I try to search for something in the search tab, it simply changes the
cursor to an hour glass and nothing happens.

I have read about similar problems in the past and have checked to make
sure the file system and the capitalization is the same inside the jar
file.

I am using jh2.0 and j2sdk 1.4.2. Please let me know if you have any
ideas, thanks.

-Ray

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

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.
surajjayan
Offline
Joined: 2009-01-28
Points: 0

Thought I'd post my findings here though this is a very old thread. I just stumbled across this thread when i was searching for an answer to the same problem. Finally I found the solution to what was causing this problem. In my .hs file, the data engine line was as follows:

en/JavaHelpSearch

Someone had placed the name of the folder"en" before the JavaHelpSearch folder name as this folder was under the en directory. I removed the "en/" and things have started working. So good to see the hour glass finally disappear and list all the search results!!

some spelling errors were corrected

Message was edited by: surajjayan

Ray Thomas

Here is the error I get when I try to use the search function in the jar
file:

Exception while creating engine named
com.sun.java.help.search.DefaultSearchEngi
ne for view: javax.help.SearchView@1f480e3
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at javax.help.search.MergingSearchEngine.makeEngine
(MergingSearchEngine.
java:169)
at javax.help.search.MergingSearchEngine.
(MergingSearchEngine.java
:63)
at javax.help.JHelpSearchNavigator.getSearchEngine
(JHelpSearchNavigator.
java:102)
at
javax.help.plaf.basic.BasicSearchNavigatorUI$SearchActionListener.act
ionPerformed(BasicSearchNavigatorUI.java:110)
at javax.swing.JTextField.fireActionPerformed(Unknown Source)
at javax.swing.JTextField.postActionEvent(Unknown Source)
at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown
Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
Source)

at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent
(Unknown Sour
ce)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions
(Unknown Sour
ce)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.security.InvalidParameterException
at com.sun.java.help.search.DefaultSearchEngine.
(DefaultSearchEngi
ne.java:75)
... 35 more

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

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

Ray Thomas wrote:

> Here is the error I get when I try to use the search function in the jar
> file:
>
>
> Exception while creating engine named
> com.sun.java.help.search.DefaultSearchEngi
> ne for view: javax.help.SearchView@1f480e3
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
> Source)
>
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
> (Unknown Sou
> rce)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at javax.help.search.MergingSearchEngine.makeEngine
> (MergingSearchEngine.
> java:169)
> at javax.help.search.MergingSearchEngine.
> (MergingSearchEngine.java
> :63)
> at javax.help.JHelpSearchNavigator.getSearchEngine
> (JHelpSearchNavigator.
> java:102)
> at
> javax.help.plaf.basic.BasicSearchNavigatorUI$SearchActionListener.act
> ionPerformed(BasicSearchNavigatorUI.java:110)
> at javax.swing.JTextField.fireActionPerformed(Unknown Source)
> at javax.swing.JTextField.postActionEvent(Unknown Source)
> at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown
> Source)
> at javax.swing.SwingUtilities.notifyAction(Unknown Source)
> at javax.swing.JComponent.processKeyBinding(Unknown Source)
> at javax.swing.JComponent.processKeyBindings(Unknown Source)
> at javax.swing.JComponent.processKeyEvent(Unknown Source)
> at java.awt.Component.processEvent(Unknown Source)
> at java.awt.Container.processEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
> at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown
> Source)
>
> at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent
> (Unknown Sour
> ce)
> at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions
> (Unknown Sour
> ce)
> at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown
> Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
> Source)
>
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
> Caused by: java.security.InvalidParameterException
> at com.sun.java.help.search.DefaultSearchEngine.
> (DefaultSearchEngi
> ne.java:75)
> ... 35 more

Most likely you either have a currupted search database or the reference
to the search database is incorrect in the helpset file.

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.

bpatel
Offline
Joined: 2009-01-08
Points: 0

Ray,
Did you ever get this working. We are having the same problem.

neha_harika
Offline
Joined: 2006-02-17
Points: 0

I am also facing the same problem. Also is there any way in which we can catch the Exceptions that are thrown and display some user-friendly message.

Thanks,
Neha.

brinkley
Offline
Joined: 2003-06-06
Points: 0

Fix your code or fix the search database. That's where the problem is.

jeffdo
Offline
Joined: 2010-11-08
Points: 0

I think this is a bug. The jsp tab library also only works when the files are local and does not work when they are in a jar file. If anyone has any additional info, it would be appreciated.

jeffdo
Offline
Joined: 2010-11-08
Points: 0

Actually I fixed my problem. It was a build problem. My ant target wasn't including all the files under my JavaHelpSearch dir. Duh...

Ray Thomas

Also,

I've checked and com.sun.java.help.search.DefaultSearchEngine.class exists
in the jar file (and in the right file structure too.) Do I need to point
the classpath somewhere else? Or point something somewhere else?

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

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.

Ray Thomas


Version 2.0//EN"
"http://java.sun.com/products/javahelp/helpset_2_0
.dtd">


jpie

main



TOC

javax.help.TOCView
toc.xml


Index

javax.help.IndexView
index.xml


Search

javax.help.SearchView
engine="com.sun.java.help.search.DefaultSearchEngine">JavaHelpSearch

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

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.

Ray Thomas

Yes it is the case you desribed: the search in the unjarred helpset works
but the search in the jarred helpset does not. So I assume the problem is
with the helpset file itself.

Here is the code I have referring to the search information, let me know
how I should edit it if you spot any glaringly obvious problems. I will
play around with the file structure and read up on the subject to try and
fix it.

Thanks for all your help.

-Ray

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

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

Ray Thomas wrote:
> Yes it is the case you desribed: the search in the unjarred helpset works
> but the search in the jarred helpset does not. So I assume the problem is
> with the helpset file itself.
>
> Here is the code I have referring to the search information, let me know
> how I should edit it if you spot any glaringly obvious problems. I will
> play around with the file structure and read up on the subject to try and
> fix it.

Include the helpset file in the message.

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.

Roger Brinkley

Ray Thomas wrote:

> Hi all,
>
> I am having difficulties using the search function of javahelp inside a
> jar file. Unjarred, the help set and search functionality work just
> fine. However, when the files are jarred, I can see the helpset but when
> I try to search for something in the search tab, it simply changes the
> cursor to an hour glass and nothing happens.
>
> I have read about similar problems in the past and have checked to make
> sure the file system and the capitalization is the same inside the jar
> file.
>
> I am using jh2.0 and j2sdk 1.4.2. Please let me know if you have any
> ideas, thanks.

I would suggest testing an unjarred and jarred HelpSet using the
hsviewer. If you can search with the unjarred but not the jarred helpset
then there is most likely a issue with the data definition for the
search view in the helpset file. Most likely this is the problem since
you're not getting any results at all. If you were getting results but
they didn't displayed when selected then that's another problem.

If this doesn't solve it post the search view section of the helpset
file and the file hierarchy that you're using for the helpset file and
the search database.

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.