Re: Lucene & Java



Mongoose wrote:
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.


Have you checked to see if you have J2EE installed along with the JDK? It contains the javax.servlet classes, and Tomcat uses J2EE from its install to do its compilation.
Can you compile normal servlets in "straight java"?
--Paul
.




Relevant Pages

  • Re: "Standard" Full Text Search Engine
    ... is there something like a standard full text search engine? ... one of those but more that is python friendly in terms of the API it ... There are several python lucene implementations available, ... tools written in java. ...
    (comp.lang.python)
  • Re: Python development time is faster.
    ... I had to work at a laboratory a few years ago which used Java exclusively. ... I was coming from several years as a graduate student using Python almost exclusively for my own work. ... Because the Lucene Java APIs don't like useful defaults. ... Unfortunately, PyLucene wraps the Lucene APIs pretty directly, but I've wrapped PyLucene with my own wrapper that adds useful defaults. ...
    (comp.lang.python)
  • Re: Zend Lucene too slow to index question
    ... I have used Lucene extensively as Java in Tomcat Servlets. ... Zend's php Lucene works the same way, but it is much slower ... when working a moderately sized site--on a shared host. ...
    (comp.lang.php)
  • Re: how to develop jsp in eclipse?
    ... I am using Eclispse 3.1.I am using it to develop java ... code.Similarly i want to use it to develop jsp code also.For that what ... I want all the features for jsp also as it is in java,such as ... web-applications in eclipse. ...
    (comp.lang.java.programmer)
  • Re: Indexing a largish collection of mail and usenet messages?
    ... I don't know lqtext, but Lucene seems to work in a similar way: a first program builds & updates an index, a second program allows to query the index. ... Using java on a BSD box is a pain, but I see Ferret, a port into C that can be glued into ruby. ...
    (freebsd-questions)