Lucene & Java



Hello everyone,

I have a small but persisting problem. I wrote .jsp code that
implements Lucene to do some very basic searching. There were some
problems that I'm fairly certain were a result of the fact that I was
running the thing through Tomcat, so I tried translating the code to
straight java.

When the code was in .jsp form it compiled fine and ran (up to a point
where it crashed, but that's beside the point). In java, it doesn't
seem to be able to pick up the location of a bunch of jar files -
these, to be exact:

import javax.servlet.http.*;
import org.apache.lucene.analysis.*;
import org.apache.lucene.document.*;
import org.apache.lucene.index.*;
import org.apache.lucene.search.*;
import org.apache.lucene.queryParser.*;
import org.apache.lucene.demo.*;
import org.apache.lucene.demo.html.Entities;

I don't understand why the .jsp would compile without errors but the
..java would not. I'm exasperated, I've gone so far as to create my own
jar file containing the .class files that came with Lucene (e.g.
<lucene-directory>/org/apache/lucene/analysis, etc.), and adding that
to the CLASSPATH. Any help would be appreciated here. Thanks in
advance.

.



Relevant Pages

  • Re: Deploying Crystal Enterprise examples with Netbeans
    ... I've tried the Business Objects web forum, ... >for learning how to display reports over the web. ... >I worked with JSP and Tomcat, and it seems to me that things have ... >These are found in the WEB-INF\lib directory, in jar files. ...
    (comp.lang.java.programmer)
  • Re: jsp sharing problem
    ... how to share one instance between all jsp pages, ... The other thing you can do is externalize the lucene index, ... Daniel Pitts' Tech Blog: ... I do put most of logics in real java code, ...
    (comp.lang.java.programmer)
  • Re: include jsp across multiple web applications in tomcat
    ... of the jsp (similar to the way you can deploy class files or jar files ... jsp:directive.include from multiple applications to include this file ...
    (comp.lang.java.programmer)
  • Re: jsp sharing problem
    ... how to share one instance between all jsp pages, ... You can use Spring MVC to help set up your application... ... The other thing you can do is externalize the lucene index, possibly via solr, which is a web-service shell that uses lucene to manage document search. ...
    (comp.lang.java.programmer)
  • Re: problem in jsp/jstl
    ... >i am new to jsp and i am learning it from oreilly JSP by Bergsten, ... Don't forget to close your tag, its requirred in XML ... >i m using tomcat 4.1 and download jstl1.1 jar files, ... >can't we made our jsp pages outside tomcat installtion directory? ...
    (comp.lang.java.programmer)