Tomcat setup question

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

Tomcat setup question

David Halsted
I've just downloaded Solr to a Windows laptop and it runs fine using
Jetty in the example, but I'm having trouble getting it to run under
Tomcat.  I looked at the page on the Wiki and back through the mailing
archives, and tried two methods that seemed to work for other people:
dropping solr/example/solr directly under the Tomcat home, and copying
solr/example/solr to a separate directory and starting Tomcat from
there (after putting solr.war in webapps).  Neither works; the first
one throws a class not found, and the second gets me part of the admin
page.  In the logs, I get this:

Nov 10, 2006 8:17:51 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.RuntimeException: Can't find resource '' in classpath or
'solr/conf/', cwd=C:\tomcat_solr
...

How can I correct that error?  I found a post that says that the
problem is that the conf files can't be found, but I didn't find any
suggestions for correcting the issue.

I guess I'm going to try setting the Java system property in
admin.jsp.  However, it would also be useful if somebody could post
somewhere an example of the changes for the JNDI settings for Tomcat.
Not sure why I'm having so much trouble with it . . .

thanks,
Dave Halsted
Reply | Threaded
Open this post in threaded view
|

Re: Tomcat setup question

Yonik Seeley-2
On 11/10/06, David Halsted <[hidden email]> wrote:
> Nov 10, 2006 8:17:51 AM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet jsp threw exception
> java.lang.RuntimeException: Can't find resource '' in classpath or
> 'solr/conf/', cwd=C:\tomcat_solr
> ...

Hi David, the exception has all the info.  One of the places Solr
looks is in the current working directory for the "solr home".

So cp -r solr_nightly/example/solr/ C:\tomcat_solr
and things should work.

> However, it would also be useful if somebody could post
> somewhere an example of the changes for the JNDI settings for Tomcat.

For tomcat, you can also use a context fragment to point to the solr
war and to the solr home.  See "Configuring Solr Home with JNDI" at
http://wiki.apache.org/solr/SolrTomcat

<Context docBase="f:/solr.war" debug="0" crossContext="true" >
   <Environment name="solr/home" type="java.lang.String"
value="f:/my/solr/home" override="true" />
</Context>


-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: Tomcat setup question

Chris Hostetter-3

: > SEVERE: Servlet.service() for servlet jsp threw exception
: > java.lang.RuntimeException: Can't find resource '' in classpath or
: > 'solr/conf/', cwd=C:\tomcat_solr
: > ...

It's pretty weird that it says: "...resource '' in..." those quotes should
contain the name of hte resource it's trying to find, making that message
more clear would be a good idea, but i don't think it's the cause of your
problem (can you send us the rest of that stack trace)

One other thing you can do to verify that your Solr configs will be found
properly is to check the log messages of Tomcat when the server is first
started ... if you are expecting the CWD to be used as Solr Home you
should see messages like this...

INFO: JNDI not configured for Solr (NoInitialContextEx)
INFO: user.dir=/home/chrish/svn/solr/example
INFO: Solr home defaulted to 'solr/'
INFO: Loaded SolrConfig: solrconfig.xml

...if you set the solr.solr.home system property explicitly, you'll see
something like this...

INFO: JNDI not configured for Solr (NoInitialContextEx)
INFO: user.dir=/home/chrish/svn/solr/example
INFO: Solr home set to '/home/hossman/tmp/solr-home/' from system property solr.solr.home

...and if you use JNDI you should see something like this...

INFO: Solr home set to '/home/chrish/tmp/solr-plugins/solr-home/'
INFO: user.dir=/home/chrish/svn/solr/example

: For tomcat, you can also use a context fragment to point to the solr
: war and to the solr home.  See "Configuring Solr Home with JNDI" at
: http://wiki.apache.org/solr/SolrTomcat

that wiki also contains the commands neccessary for the shortest possible
Solr/Tomcat install you can do just to sanity check that there's nothing
really wonky with your tomcat installation (it was for unix, but the basic
idea should work for windows as well)



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: Tomcat setup question

David Halsted
Thanks for all the help -- I got it figured out.  Turned out I created
a lot of my own problems (never mind how).  Once I undid my own damage
I was able to get it running with the JNDI configuration.  I never did
get the simpler approaches to work, though.

Dave

On 11/10/06, Chris Hostetter <[hidden email]> wrote:

>
> : > SEVERE: Servlet.service() for servlet jsp threw exception
> : > java.lang.RuntimeException: Can't find resource '' in classpath or
> : > 'solr/conf/', cwd=C:\tomcat_solr
> : > ...
>
> It's pretty weird that it says: "...resource '' in..." those quotes should
> contain the name of hte resource it's trying to find, making that message
> more clear would be a good idea, but i don't think it's the cause of your
> problem (can you send us the rest of that stack trace)
>
> One other thing you can do to verify that your Solr configs will be found
> properly is to check the log messages of Tomcat when the server is first
> started ... if you are expecting the CWD to be used as Solr Home you
> should see messages like this...
>
> INFO: JNDI not configured for Solr (NoInitialContextEx)
> INFO: user.dir=/home/chrish/svn/solr/example
> INFO: Solr home defaulted to 'solr/'
> INFO: Loaded SolrConfig: solrconfig.xml
>
> ...if you set the solr.solr.home system property explicitly, you'll see
> something like this...
>
> INFO: JNDI not configured for Solr (NoInitialContextEx)
> INFO: user.dir=/home/chrish/svn/solr/example
> INFO: Solr home set to '/home/hossman/tmp/solr-home/' from system property solr.solr.home
>
> ...and if you use JNDI you should see something like this...
>
> INFO: Solr home set to '/home/chrish/tmp/solr-plugins/solr-home/'
> INFO: user.dir=/home/chrish/svn/solr/example
>
> : For tomcat, you can also use a context fragment to point to the solr
> : war and to the solr home.  See "Configuring Solr Home with JNDI" at
> : http://wiki.apache.org/solr/SolrTomcat
>
> that wiki also contains the commands neccessary for the shortest possible
> Solr/Tomcat install you can do just to sanity check that there's nothing
> really wonky with your tomcat installation (it was for unix, but the basic
> idea should work for windows as well)
>
>
>
> -Hoss
>
>