Problem instantiating CommonsHttpSolrServer using solrj

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem instantiating CommonsHttpSolrServer using solrj

bijeet singh
Hi all,

I'm trying to use solrj for indexing in solr, but when I try to instantiate
the server, using :

SolrServer server = new CommonsHttpSolrServer("http://localhost:8080/solr");

 I get the following runtime error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/solr/client/solrj/SolrServerException
Caused by: java.lang.ClassNotFoundException:
org.apache.solr.client.solrj.SolrServerException
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)


I am following the this link :  http://wiki.apache.org/solr/Solrj   ,and
have included all the jar files specified there, in the classpath.


Do help me out with this, thanks in advance

Bijeet
Reply | Threaded
Open this post in threaded view
|

Re: Problem instantiating CommonsHttpSolrServer using solrj

Chris Hostetter-3

:  I get the following runtime error:
:
: Exception in thread "main" java.lang.NoClassDefFoundError:
: org/apache/solr/client/solrj/SolrServerException
: Caused by: java.lang.ClassNotFoundException:
: org.apache.solr.client.solrj.SolrServerException
        ...
: I am following the this link :  http://wiki.apache.org/solr/Solrj   ,and
: have included all the jar files specified there, in the classpath.

Are you certain?

the class it can't find is
org.apache.solr.client.solrj.SolrServerException which is definitely in  
the apache-solr-solrj-*.jar

did you perchance copy the list of jars verbatim from that wiki? because
someone seems to have made a typo and called it "solr-solrj-1.4.0.jar"
instead of "apache-solr-solrj-1.4.0.jar" but if you actually *look* at the
jars available, it's pretty obvious.


-Hoss

pla
Reply | Threaded
Open this post in threaded view
|

Re: Problem instantiating CommonsHttpSolrServer using solrj

pla
I went through jar hell yesterday. I finally got Solrj working.
http://jarfinder.com was a big help.

Rock on, PLA

Patrick L Archibald
http://patrickarchibald.com



On Fri, Aug 13, 2010 at 7:25 PM, Chris Hostetter
<[hidden email]>wrote:

>
> :  I get the following runtime error:
> :
> : Exception in thread "main" java.lang.NoClassDefFoundError:
> : org/apache/solr/client/solrj/SolrServerException
> : Caused by: java.lang.ClassNotFoundException:
> : org.apache.solr.client.solrj.SolrServerException
>         ...
> : I am following the this link :  http://wiki.apache.org/solr/Solrj   ,and
> : have included all the jar files specified there, in the classpath.
>
> Are you certain?
>
> the class it can't find is
> org.apache.solr.client.solrj.SolrServerException which is definitely in
> the apache-solr-solrj-*.jar
>
> did you perchance copy the list of jars verbatim from that wiki? because
> someone seems to have made a typo and called it "solr-solrj-1.4.0.jar"
> instead of "apache-solr-solrj-1.4.0.jar" but if you actually *look* at the
> jars available, it's pretty obvious.
>
>
> -Hoss
>
>