• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Lucene 3.6.1 on Tomcat 5.5.27 on HP-UNIX 11i v3

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I logon the HP-UNIX 11i v3 as root

1) I download the lucene 3.6.1 and extact to folder : /opt/hpws/tomcat/webapps/lucene
2) I set the CLASSPATH
export CLASSPATH=/opt/hpws/tomcat/webapps/lucene

Then I run the following command
java org.apache.lucene.demo.IndexFiles -docs /opt/hpws/tomcat/webapps/lucene/contrib/demo/src

I got error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/demo/IndexFiles

PLEASE HLEP for This issue.

Thanks a lot
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to have both lucene-core-3.6.1.jar & lucene-demo-3.6.1.jar in your classpath. The latter is in /contrib/demo/

This has nothing to do with Tomcat.
 
David Moo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have both jar files under the classpath lucene-demo-3.6.1.jar & lucene-core-3.6.1.jar
But Still got error.

Can you help? Thanks


[root@devserver:/opt/hpws/tomcat/webapps/lucene]ls -l
total 23488
-rwxr--r-- 1 root sys 280171 Jul 17 12:21 CHANGES.txt
-rwxr--r-- 1 root sys 1616 Jul 17 09:41 JRE_VERSION_MIGRATION.txt
-rwxr--r-- 1 root sys 17778 Jul 17 09:41 LICENSE.txt
-rwxr--r-- 1 root sys 8780 Jul 17 09:41 NOTICE.txt
-rwxr--r-- 1 root sys 1383 Jul 17 09:41 README.txt
drwxr-xr-x 20 root sys 8192 Sep 10 14:33 contrib
drwxr-xr-x 7 root sys 8192 Sep 10 14:36 docs
-rwxr--r-- 1 root sys 3648793 Jul 17 12:37 lucene-core-3.6.1-javadoc.jar
-rwxr--r-- 1 root sys 1537988 Jul 17 12:36 lucene-core-3.6.1.jar
-rwxr--r-- 1 root sys 44168 Sep 12 11:33 lucene-demo-3.6.1-javadoc.jar
-rwxr--r-- 1 root sys 16854 Sep 12 11:32 lucene-demo-3.6.1.jar
-rwxr--r-- 1 root sys 431334 Jul 17 12:38 lucene-test-framework-3.6.1-javadoc.jar
-rwxr--r-- 1 root sys 5955900 Jul 17 12:36 lucene-test-framework-3.6.1.jar
drwxr-xr-x 3 root sys 96 Sep 10 14:32 test-framework
[root@devserver:/opt/hpws/tomcat/webapps/lucene]java org.apache.lucene.demo.IndexFiles -docs /opt/hpws/tomcat/webapps/lucene/src
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/demo/IndexFiles
 
sridhar chandramouli
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The presence of the jars in the directory doesn't mean they're in your classpath. Run your java command with the -cp option to make sure the jars are available:

java -cp lucene-demo-3.6.1.jar:lucene-core-3.6.1.jar org.apache.lucene.demo.IndexFiles -docs /opt/hpws/tomcat/webapps/lucene/contrib/demo/src
 
David Moo
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much...
After I run the command, I got the index folder; What's the next step to lunch the search webpage.
In my IE browser, what the URL I should type. Thanks again.


/opt/hpws/tomcat/webapps/lucene/index]ls -l
total 256
-rw-r--r-- 1 root sys 1762 Sep 13 08:41 _0.fdt
-rw-r--r-- 1 root sys 132 Sep 13 08:41 _0.fdx
-rw-r--r-- 1 root sys 32 Sep 13 08:41 _0.fnm
-rw-r--r-- 1 root sys 10592 Sep 13 08:41 _0.frq
-rw-r--r-- 1 root sys 20 Sep 13 08:41 _0.nrm
-rw-r--r-- 1 root sys 32168 Sep 13 08:41 _0.prx
-rw-r--r-- 1 root sys 313 Sep 13 08:41 _0.tii
-rw-r--r-- 1 root sys 18627 Sep 13 08:41 _0.tis
-rw-r--r-- 1 root sys 20 Sep 13 08:41 segments.gen
-rw-r--r-- 1 root sys 244 Sep 13 08:41 segments_1


 
sridhar chandramouli
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No webpage. You've indexed your documents - now you can search them using:

java -cp lucene-demo-3.6.1.jar:lucene-core-3.6.1.jar org.apache.lucene.demo.SearchFiles

You can create your own webapp to use the classes in those jars. As mentioned earlier this has nothing to do with webapps & tomcat.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic