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 Leonardo Souza <le...@gmail.com> on 2009/11/16 14:03:41 UTC

EmbeddedSolrServer: java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

Hi,

I'm newbie using Solr and I'd like to run some tests against our data set. I
have successful tested Solr + Cell using the standard Http Solr server
and now we need to test the Embedded solution and when a try to start the
embedded server i get this exception:

INFO: registering core:
Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
javax/servlet/ServletRequest
    at
org.apache.solr.servlet.SolrRequestParsers.<init>(SolrRequestParsers.java:94)
    at
org.apache.solr.client.solrj.embedded.EmbeddedSolrServer.<init>(EmbeddedSolrServer.java:90)
    at petrobras.ep.solrindexer.Embedded$1.run(Embedded.java:25)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRequest
    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)

The EmbeddedSolrServer depends on servlet-api?
I'm facing a lack of documentation about EmbeddedSolrServer, all
documentation is at http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer?

thanks in advance!

[ ]'s
Leonardo da S. Souza
°v°   Linux user #375225
/(_)\   http://counter.li.org/
^ ^

Re: EmbeddedSolrServer: java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

Posted by Leonardo Souza <le...@gmail.com>.
Thanks a lot Hoss!

[ ]'s
Leonardo da S. Souza
°v°   Linux user #375225
/(_)\   http://counter.li.org/
^ ^



On Tue, Nov 17, 2009 at 6:12 PM, Chris Hostetter
<ho...@fucit.org>wrote:

>
> : I'm newbie using Solr and I'd like to run some tests against our data
> set. I
> : have successful tested Solr + Cell using the standard Http Solr server
> : and now we need to test the Embedded solution and when a try to start the
> : embedded server i get this exception:
> :
> : INFO: registering core:
> : Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
> : javax/servlet/ServletRequest
>         ...
> : The EmbeddedSolrServer depends on servlet-api?
>
> ...unfortunately yes, the core solr code base has a dependency on the
> servlet API because it can parse requests coming from an
> HttpServletRequest.  If you are interested in providing a patch it would
> probably be relatively easy to refactor that parsing code into the
> src/webapp directory (which was intended to be the only place with servlet
> api dependencies)
>
> : I'm facing a lack of documentation about EmbeddedSolrServer, all
> : documentation is at http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer
> ?
>
> yep, that's pretty much it.  EmbeddedSolr tends to be fairly advanced
> usage, for people you are not only familiar with java, but also have a
> particular need to embed directly into their app instead of runing SOlr as
> a server.
>
>
>
> -Hoss
>
>

Re: EmbeddedSolrServer: java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

Posted by Chris Hostetter <ho...@fucit.org>.
: I'm newbie using Solr and I'd like to run some tests against our data set. I
: have successful tested Solr + Cell using the standard Http Solr server
: and now we need to test the Embedded solution and when a try to start the
: embedded server i get this exception:
: 
: INFO: registering core:
: Exception in thread "Thread-1" java.lang.NoClassDefFoundError:
: javax/servlet/ServletRequest
	...
: The EmbeddedSolrServer depends on servlet-api?

...unfortunately yes, the core solr code base has a dependency on the 
servlet API because it can parse requests coming from an 
HttpServletRequest.  If you are interested in providing a patch it would 
probably be relatively easy to refactor that parsing code into the 
src/webapp directory (which was intended to be the only place with servlet 
api dependencies)

: I'm facing a lack of documentation about EmbeddedSolrServer, all
: documentation is at http://wiki.apache.org/solr/Solrj#EmbeddedSolrServer?

yep, that's pretty much it.  EmbeddedSolr tends to be fairly advanced 
usage, for people you are not only familiar with java, but also have a 
particular need to embed directly into their app instead of runing SOlr as 
a server.



-Hoss