You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ian Lea <ia...@gmail.com> on 2010/07/30 15:39:29 UTC

Re: Highlighter wildcard problems: NoClassDefFoundError in Linux/CentOS 5.4, works in Windows XP

Your linux set up is evidently missing a jar file - the one that contains
org/apache/lucene/index/memory/MemoryIndex.   Or it is there but not in the
CLASSPATH, or something else along those lines.


--
Ian.


On Fri, Jul 30, 2010 at 2:30 PM, Markus Roth <m....@stoeu.com> wrote:

>
>
> Hello everyone,
>
> I'm using lucene for obvious purposes and I'm trying to highlight
> search-term results.
>
> libraries I use:
> lucene-core version: 3.0.2
> lucene-highlighter version: 3.0.2
>
> Dev-System:
> WinXP Pro 32Bit, jdk1.6.0_20,
> java version "1.6.0_20"
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
> Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
>
> Server-System:
> Centos 5.4 Final x64 (in a VM),
> java version "1.6.0"
> OpenJDK Runtime Environment (build 1.6.0-b09)
> OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)
>
> I created a small Httpserver(in Java) that responds to POST/GET. A small
> form will POST search terms which are then passed
> to the IndexSearcher. After that the highlighter is supposed to highlight
> search-term hits. (everything is set to use UTF-8)
>
> When I use * as a wildcard in a search-term while the application is
> running in Windows, everything is fine and the results are
> returned as expected. However, same is not true for CentOS. The following
> Exception is thrown for the same build with the same
> query:
>
> Exception in thread "pool-4-thread-4" java.lang.NoClassDefFoundError:
> org/apache/lucene/index/memory/MemoryIndex
> at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor$FakeReader.<clinit>(WeightedSpanTermExtractor.java:560)
> at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:153)
> at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:97)
> at
> org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:383)
> at
> org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:216)
> at
> org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:184)
> at
> org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:200)
> at com.stoeu.parsing.stoQueryParser.query(stoQueryParser.java:129)
> at com.stoeu.parsing.stoQueryParser.query(stoQueryParser.java:336)
> at com.stoeu.query.MyHttpHandler.handle(MyHttpHandler.java:127)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:83)
> at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:86)
> at
> sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:589)
> at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:83)
> at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:561)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:636)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.lucene.index.memory.MemoryIndex
> at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
> ... 19 more
>
>
> Anyone got an idea what's wrong?
>
> Greetings,
> Markus
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Sto AG, Ehrenbachstr.1, D-79780 Stuehlingen
>
> Vorstand/Board: Jochen Stotmeister (Vorsitzender/Chairman),
> Gerd Stotmeister, Hans-Dieter Schumacher
> Aufsichtsratsvorsitzender/Chairman Supervisory Board:
> Dr. Max-Burkhard Zwosta
>
> Sitz der Gesellschaft/Head Office: D-79780 Stuehlingen
> Handelsregister/Registration: Amtsgericht Freiburg HRB 620675
> USt-ID/Tax ID: DE142834082
> =============================================================
>

Antwort: Re: Re: Highlighter wildcard problems: NoClassDefFoundError in Linux/CentOS 5.4, works in Windows XP

Posted by Markus Roth <m....@stoeu.com>.




Well it turns out that your suggestion was true. I added
lucene-memory-3.0.2.jar from the contrib/memory folder to the CLASSPATH and
it works.
The odd thing is that I most definitely have not added the jar to the CP in
Windows - and there wildcards work (with just core and highlight).

Thanks and greetings,
Markus


                                                                           
             Ian Lea                                                       
             <ian.lea@gmail                                                
             .com>                                                      An 
                                     java-user@lucene.apache.org           
             30.07.2010                                              Kopie 
             15:51                                                         
                                                                     Thema 
                                     Re: Re: Highlighter wildcard          
                 Bitte               problems: NoClassDefFoundError in     
              antworten an           Linux/CentOS 5.4, works in Windows XP 
             java-user@luce                                                
             ne.apache.org                                                 
                                                                           
                                                                           
                                                                           
                                                                           




Because the highlighter only uses MemoryIndex if wildcards are involved?  I
don't use the highlighter package so have no idea if that is correct or
not,
but the message

 java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex

is clear.  The jvm can't find that class.


--
Ian.


On Fri, Jul 30, 2010 at 2:46 PM, Markus Roth <m....@stoeu.com> wrote:

>
>
>
> First of all, thanks for your response.
> But how can that be true if a search-term without a wildcard (and the
> highlighting of the results) works fine?
>
> Greetings,
> Markus
>
>
> [image: Inactive hide details for Ian Lea ---30.07.2010 15:42:05---Your
> linux set up is evidently missing a jar file - the one that con]Ian Lea
> ---30.07.2010 15:42:05---Your linux set up is evidently missing a jar
file -
> the one that contains
>
>
>     *Ian Lea <ia...@gmail.com>*
>
>             30.07.2010 15:39
>             Bitte antworten an
>             java-user@lucene.apache.org
>
>
> An
>
> java-user@lucene.apache.org
> Kopie
>
>
> Thema
>
> Re: Highlighter wildcard problems: NoClassDefFoundError in Linux/CentOS
> 5.4, works in Windows XP
>
> Your linux set up is evidently missing a jar file - the one that contains
> org/apache/lucene/index/memory/MemoryIndex.   Or it is there but not in
the
> CLASSPATH, or something else along those lines.
>
>
> --
> Ian.
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Sto AG, Ehrenbachstr.1, D-79780 Stuehlingen
>
> Vorstand/Board: Jochen Stotmeister (Vorsitzender/Chairman),
> Gerd Stotmeister, Hans-Dieter Schumacher
> Aufsichtsratsvorsitzender/Chairman Supervisory Board:
> Dr. Max-Burkhard Zwosta
>
> Sitz der Gesellschaft/Head Office: D-79780 Stuehlingen
> Handelsregister/Registration: Amtsgericht Freiburg HRB 620675
> USt-ID/Tax ID: DE142834082
> =============================================================
>


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sto AG, Ehrenbachstr.1, D-79780 Stuehlingen

Vorstand/Board: Jochen Stotmeister (Vorsitzender/Chairman),
Gerd Stotmeister, Hans-Dieter Schumacher
Aufsichtsratsvorsitzender/Chairman Supervisory Board:
Dr. Max-Burkhard Zwosta

Sitz der Gesellschaft/Head Office: D-79780 Stuehlingen
Handelsregister/Registration: Amtsgericht Freiburg HRB 620675
USt-ID/Tax ID: DE142834082
=============================================================

Re: Re: Highlighter wildcard problems: NoClassDefFoundError in Linux/CentOS 5.4, works in Windows XP

Posted by Ian Lea <ia...@gmail.com>.
Because the highlighter only uses MemoryIndex if wildcards are involved?  I
don't use the highlighter package so have no idea if that is correct or not,
but the message

 java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex

is clear.  The jvm can't find that class.


--
Ian.


On Fri, Jul 30, 2010 at 2:46 PM, Markus Roth <m....@stoeu.com> wrote:

>
>
>
> First of all, thanks for your response.
> But how can that be true if a search-term without a wildcard (and the
> highlighting of the results) works fine?
>
> Greetings,
> Markus
>
>
> [image: Inactive hide details for Ian Lea ---30.07.2010 15:42:05---Your
> linux set up is evidently missing a jar file - the one that con]Ian Lea
> ---30.07.2010 15:42:05---Your linux set up is evidently missing a jar file -
> the one that contains
>
>
>     *Ian Lea <ia...@gmail.com>*
>
>             30.07.2010 15:39
>             Bitte antworten an
>             java-user@lucene.apache.org
>
>
> An
>
> java-user@lucene.apache.org
> Kopie
>
>
> Thema
>
> Re: Highlighter wildcard problems: NoClassDefFoundError in Linux/CentOS
> 5.4, works in Windows XP
>
> Your linux set up is evidently missing a jar file - the one that contains
> org/apache/lucene/index/memory/MemoryIndex.   Or it is there but not in the
> CLASSPATH, or something else along those lines.
>
>
> --
> Ian.
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Sto AG, Ehrenbachstr.1, D-79780 Stuehlingen
>
> Vorstand/Board: Jochen Stotmeister (Vorsitzender/Chairman),
> Gerd Stotmeister, Hans-Dieter Schumacher
> Aufsichtsratsvorsitzender/Chairman Supervisory Board:
> Dr. Max-Burkhard Zwosta
>
> Sitz der Gesellschaft/Head Office: D-79780 Stuehlingen
> Handelsregister/Registration: Amtsgericht Freiburg HRB 620675
> USt-ID/Tax ID: DE142834082
> =============================================================
>

Antwort: Re: Highlighter wildcard problems: NoClassDefFoundError in Linux/CentOS 5.4, works in Windows XP

Posted by Markus Roth <m....@stoeu.com>.




First of all, thanks for your response.
But how can that be true if a search-term without a wildcard (and the
highlighting of the results) works fine?

Greetings,
Markus



                                                                           
             Ian Lea                                                       
             <ian.lea@gmail                                                
             .com>                                                      An 
                                     java-user@lucene.apache.org           
             30.07.2010                                              Kopie 
             15:39                                                         
                                                                     Thema 
                                     Re: Highlighter wildcard problems:    
                 Bitte               NoClassDefFoundError in            
              antworten an           Linux/CentOS 5.4, works in Windows XP 
             java-user@luce                                                
             ne.apache.org                                                 
                                                                           
                                                                           
                                                                           
                                                                           




Your linux set up is evidently missing a jar file - the one that contains
org/apache/lucene/index/memory/MemoryIndex.   Or it is there but not in the
CLASSPATH, or something else along those lines.


--
Ian.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sto AG, Ehrenbachstr.1, D-79780 Stuehlingen

Vorstand/Board: Jochen Stotmeister (Vorsitzender/Chairman),
Gerd Stotmeister, Hans-Dieter Schumacher
Aufsichtsratsvorsitzender/Chairman Supervisory Board:
Dr. Max-Burkhard Zwosta

Sitz der Gesellschaft/Head Office: D-79780 Stuehlingen
Handelsregister/Registration: Amtsgericht Freiburg HRB 620675
USt-ID/Tax ID: DE142834082
=============================================================