aspose file tools*
The moose likes Tomcat and the fly likes Lucene 3.6.1 on Tomcat 5.5.27 on HP-UNIX 11i v3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Lucene 3.6.1 on Tomcat 5.5.27 on HP-UNIX 11i v3" Watch "Lucene 3.6.1 on Tomcat 5.5.27 on HP-UNIX 11i v3" New topic
Author

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

David Moo
Greenhorn

Joined: Sep 10, 2012
Posts: 6
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
sridhar chandramouli
Greenhorn

Joined: Apr 13, 2011
Posts: 6
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

Joined: Sep 10, 2012
Posts: 6
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

Joined: Apr 13, 2011
Posts: 6
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

Joined: Sep 10, 2012
Posts: 6
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

Joined: Apr 13, 2011
Posts: 6
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Lucene 3.6.1 on Tomcat 5.5.27 on HP-UNIX 11i v3