You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Gavin Engel <ga...@engel.com> on 2011/05/04 01:26:07 UTC

An error I can't manage to fix: java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin

Hello all,

I've been trying to add the Spatial Search Plugin to my Solr 1.4.1 setup,
and I get this error:


> java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin
> at java.lang.ClassLoader.defineClass1(Native Method)
>  at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>  at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
> ...
> Caused by: java.lang.ClassNotFoundException:
> org.apache.solr.search.QParserPlugin
> 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:321)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>  ... 50 more



I've been trying my best with the devlopers' documentation, but I am still
stuck on the install phase of SSP 2.0.  I wonder if there are users of SSP 2
that can help me troubleshoot this, please?

-Gavin

Re: An error I can't manage to fix: java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin

Posted by Markus Jelsma <ma...@openindex.io>.
So, you're using Jetty. That's indeed a place to store the file when using 
Jetty. 

> Oh, I apparently figured out how to get the jar file to load, so problem is
> solved I suppose.
> 
> The fix seems very odd to me, but I got it from a comment on the SSP 2 blog
> page (
> http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/co
> mment-page-1/#comment-4774 ):
> 
> The solution, for those of you getting the NoClassDefFoundError exception
> thrown, is to put the jar file in your example directory, under:
> solr/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/
> 
> 
> 
> 
> 
> I created that odd directory structure first, copied in the jar, and
> started Jetty.  It looked like the jar was deleted, so I re-copied the jar
> into it. The second time around, everything seems to have worked.
> 
> I am lost as to why its looking in that strange folder structure for the
> jar file, instead of ./lib or ./solr/lib.
> 
> On Tue, May 3, 2011 at 4:35 PM, Markus Jelsma 
<ma...@openindex.io>wrote:
> > Where did you store the jar? Is it in a directory Solr looks for libs?
> > Depending on your distro or set up there can be different places to store
> > the
> > jar. The easiest solution is to put it in a dir where other Solr libs are
> > found or in a dir that you configured in a <lib> directive in solrconfig.
> > 
> > > Hello all,
> > > 
> > > I've been trying to add the Spatial Search Plugin to my Solr 1.4.1
> > > setup,
> > > 
> > > and I get this error:
> > > > java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin
> > > > at java.lang.ClassLoader.defineClass1(Native Method)
> > > > 
> > > >  at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
> > > > 
> > > > at
> > > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
> > > > 2)
> > > > 
> > > >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
> > > > 
> > > > ...
> > > > Caused by: java.lang.ClassNotFoundException:
> > > > org.apache.solr.search.QParserPlugin
> > > > 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:321)
> > > > 
> > > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> > > > 
> > > >  ... 50 more
> > > 
> > > I've been trying my best with the devlopers' documentation, but I am
> > 
> > still
> > 
> > > stuck on the install phase of SSP 2.0.  I wonder if there are users of
> > 
> > SSP
> > 
> > > 2 that can help me troubleshoot this, please?
> > > 
> > > -Gavin

Re: An error I can't manage to fix: java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin

Posted by Gavin Engel <ga...@engel.com>.
I have a couple <lib> directives in my solrconfig.xml:

<lib dir="./lib" />
<lib dir="/home/user/apache-solr-1.4.1/example/solr/lib/" />

Both of those should work, as far as I know.  Those are pointing to 2
different folders, and both have a copy of my jar file in them.  Yet, for
some reason Solr doesn't see them.  I'd love to know why.

On Wed, May 4, 2011 at 5:13 AM, Erick Erickson <er...@gmail.com>wrote:

> This is pretty fragile, the Jetty work directories come and go.
>
> I predict it will keep disappearing and/or you'll go through this same
> hassle
> next time you re-install or move to a new machine or...
>
> You *should* be able to just remove that directory entirely and still start
> w/o
> copying the jar.
>
> Are you absolutely sure you have a <lib> directive in your solrconfig.xml
> file that paths to a directory that has your spatial jar in it?
>
> Best
> Erick
>
> On Tue, May 3, 2011 at 8:42 PM, Gavin Engel <ga...@engel.com> wrote:
> > Oh, I apparently figured out how to get the jar file to load, so problem
> is
> > solved I suppose.
> >
> > The fix seems very odd to me, but I got it from a comment on the SSP 2
> blog
> > page (
> >
> http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/comment-page-1/#comment-4774
> > ):
> >
> > The solution, for those of you getting the NoClassDefFoundError exception
> > thrown, is to put the jar file in your example directory, under:
> > solr/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/
> >
> >
> >
> >
> >
> > I created that odd directory structure first, copied in the jar, and
> started
> > Jetty.  It looked like the jar was deleted, so I re-copied the jar into
> it.
> >  The second time around, everything seems to have worked.
> >
> > I am lost as to why its looking in that strange folder structure for the
> jar
> > file, instead of ./lib or ./solr/lib.
> >
> >
> >
> > On Tue, May 3, 2011 at 4:35 PM, Markus Jelsma <
> markus.jelsma@openindex.io>wrote:
> >
> >> Where did you store the jar? Is it in a directory Solr looks for libs?
> >> Depending on your distro or set up there can be different places to
> store
> >> the
> >> jar. The easiest solution is to put it in a dir where other Solr libs
> are
> >> found or in a dir that you configured in a <lib> directive in
> solrconfig.
> >>
> >> > Hello all,
> >> >
> >> > I've been trying to add the Spatial Search Plugin to my Solr 1.4.1
> setup,
> >> >
> >> > and I get this error:
> >> > > java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin
> >> > > at java.lang.ClassLoader.defineClass1(Native Method)
> >> > >
> >> > >  at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
> >> > >
> >> > > at
> >> > >
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> >> > >
> >> > >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
> >> > >
> >> > > ...
> >> > > Caused by: java.lang.ClassNotFoundException:
> >> > > org.apache.solr.search.QParserPlugin
> >> > > 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:321)
> >> > >
> >> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> >> > >
> >> > >  ... 50 more
> >> >
> >> > I've been trying my best with the devlopers' documentation, but I am
> >> still
> >> > stuck on the install phase of SSP 2.0.  I wonder if there are users of
> >> SSP
> >> > 2 that can help me troubleshoot this, please?
> >> >
> >> > -Gavin
> >>
> >
>

Re: An error I can't manage to fix: java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin

Posted by Erick Erickson <er...@gmail.com>.
This is pretty fragile, the Jetty work directories come and go.

I predict it will keep disappearing and/or you'll go through this same hassle
next time you re-install or move to a new machine or...

You *should* be able to just remove that directory entirely and still start w/o
copying the jar.

Are you absolutely sure you have a <lib> directive in your solrconfig.xml
file that paths to a directory that has your spatial jar in it?

Best
Erick

On Tue, May 3, 2011 at 8:42 PM, Gavin Engel <ga...@engel.com> wrote:
> Oh, I apparently figured out how to get the jar file to load, so problem is
> solved I suppose.
>
> The fix seems very odd to me, but I got it from a comment on the SSP 2 blog
> page (
> http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/comment-page-1/#comment-4774
> ):
>
> The solution, for those of you getting the NoClassDefFoundError exception
> thrown, is to put the jar file in your example directory, under:
> solr/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/
>
>
>
>
>
> I created that odd directory structure first, copied in the jar, and started
> Jetty.  It looked like the jar was deleted, so I re-copied the jar into it.
>  The second time around, everything seems to have worked.
>
> I am lost as to why its looking in that strange folder structure for the jar
> file, instead of ./lib or ./solr/lib.
>
>
>
> On Tue, May 3, 2011 at 4:35 PM, Markus Jelsma <ma...@openindex.io>wrote:
>
>> Where did you store the jar? Is it in a directory Solr looks for libs?
>> Depending on your distro or set up there can be different places to store
>> the
>> jar. The easiest solution is to put it in a dir where other Solr libs are
>> found or in a dir that you configured in a <lib> directive in solrconfig.
>>
>> > Hello all,
>> >
>> > I've been trying to add the Spatial Search Plugin to my Solr 1.4.1 setup,
>> >
>> > and I get this error:
>> > > java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin
>> > > at java.lang.ClassLoader.defineClass1(Native Method)
>> > >
>> > >  at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
>> > >
>> > > at
>> > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>> > >
>> > >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
>> > >
>> > > ...
>> > > Caused by: java.lang.ClassNotFoundException:
>> > > org.apache.solr.search.QParserPlugin
>> > > 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:321)
>> > >
>> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>> > >
>> > >  ... 50 more
>> >
>> > I've been trying my best with the devlopers' documentation, but I am
>> still
>> > stuck on the install phase of SSP 2.0.  I wonder if there are users of
>> SSP
>> > 2 that can help me troubleshoot this, please?
>> >
>> > -Gavin
>>
>

Re: An error I can't manage to fix: java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin

Posted by Gavin Engel <ga...@engel.com>.
Oh, I apparently figured out how to get the jar file to load, so problem is
solved I suppose.

The fix seems very odd to me, but I got it from a comment on the SSP 2 blog
page (
http://blog.jteam.nl/2009/08/03/geo-location-search-with-solr-and-lucene/comment-page-1/#comment-4774
):

The solution, for those of you getting the NoClassDefFoundError exception
thrown, is to put the jar file in your example directory, under:
solr/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/





I created that odd directory structure first, copied in the jar, and started
Jetty.  It looked like the jar was deleted, so I re-copied the jar into it.
 The second time around, everything seems to have worked.

I am lost as to why its looking in that strange folder structure for the jar
file, instead of ./lib or ./solr/lib.



On Tue, May 3, 2011 at 4:35 PM, Markus Jelsma <ma...@openindex.io>wrote:

> Where did you store the jar? Is it in a directory Solr looks for libs?
> Depending on your distro or set up there can be different places to store
> the
> jar. The easiest solution is to put it in a dir where other Solr libs are
> found or in a dir that you configured in a <lib> directive in solrconfig.
>
> > Hello all,
> >
> > I've been trying to add the Spatial Search Plugin to my Solr 1.4.1 setup,
> >
> > and I get this error:
> > > java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin
> > > at java.lang.ClassLoader.defineClass1(Native Method)
> > >
> > >  at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
> > >
> > > at
> > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> > >
> > >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
> > >
> > > ...
> > > Caused by: java.lang.ClassNotFoundException:
> > > org.apache.solr.search.QParserPlugin
> > > 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:321)
> > >
> > > at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> > >
> > >  ... 50 more
> >
> > I've been trying my best with the devlopers' documentation, but I am
> still
> > stuck on the install phase of SSP 2.0.  I wonder if there are users of
> SSP
> > 2 that can help me troubleshoot this, please?
> >
> > -Gavin
>

Re: An error I can't manage to fix: java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin

Posted by Markus Jelsma <ma...@openindex.io>.
Where did you store the jar? Is it in a directory Solr looks for libs? 
Depending on your distro or set up there can be different places to store the 
jar. The easiest solution is to put it in a dir where other Solr libs are 
found or in a dir that you configured in a <lib> directive in solrconfig.

> Hello all,
> 
> I've been trying to add the Spatial Search Plugin to my Solr 1.4.1 setup,
> 
> and I get this error:
> > java.lang.NoClassDefFoundError: org/apache/solr/search/QParserPlugin
> > at java.lang.ClassLoader.defineClass1(Native Method)
> > 
> >  at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
> > 
> > at
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> > 
> >  at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
> > 
> > ...
> > Caused by: java.lang.ClassNotFoundException:
> > org.apache.solr.search.QParserPlugin
> > 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:321)
> > 
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> > 
> >  ... 50 more
> 
> I've been trying my best with the devlopers' documentation, but I am still
> stuck on the install phase of SSP 2.0.  I wonder if there are users of SSP
> 2 that can help me troubleshoot this, please?
> 
> -Gavin