Re: solr setup

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

Re: solr setup

Marcus Stratmann
Hi,

I have a tomcat5 running under linux (debian). I think that
my configuration may be wrong, because I don't get solr running.

Yonik Seeley wrote:
>the layout should look something like this:
>
>tomcat/webapps/solr.war
>tomcat/solrconf/solrconfig.xml, schema.xml, etc
>tomcat/bin/startup.sh
>
>then start tomcat by executing
>./bin/startup.sh
>from the tomcat directory

Well, there's no bin in my tomcat5 directory. I start tomcat
using "/etc/init.d/tomcat5 start". May this be a problem?

This is what I've done:
I compiled the source and copied solr-1.0.war to
/var/lib/tomcat5/webapps/solr.war. Then I copied the solrconf dir
from example to /var/lib/tomcat5/ and started tomcat.
tomcat then builds a solr dir in /var/lib/tomcat5/webapps. Fine so
far, but when I call http://localhost:8180/solr/admin/ for the first
time, I get
this:

javax.servlet.ServletException
        org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
        org.apache.jasper.runtime.PageContextImpl.access$11(PageContextImpl.java:784)
        org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:766)
        java.security.AccessController.doPrivileged(Native
Method)
        org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:764)
        org.apache.jsp.admin.index_jsp._jspService(index_jsp.java:262)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:585)
        org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        java.security.AccessController.doPrivileged(Native
Method)
        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
        org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)

root
cause

java.lang.ExceptionInInitializerError
        org.apache.solr.core.SolrConfig.<clinit>(SolrConfig.java:33)
        org.apache.solr.update.SolrIndexConfig.<clinit>(SolrIndexConfig.java:34)
        org.apache.solr.core.SolrCore.<clinit>(SolrCore.java:71)
        org.apache.jsp.admin.index_jsp._jspService(index_jsp.java:67)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:585)
        org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        java.security.AccessController.doPrivileged(Native
Method)
        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
        org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)



Calling the page again slightly changes the "root cause"
to:

java.lang.NoClassDefFoundError
        org.apache.jsp.admin.index_jsp._jspService(index_jsp.java:67)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:585)
        org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        java.security.AccessController.doPrivileged(Native
Method)
        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
        org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)


Do I have to change the solr configuration in some way?

Thanks,
Marcus

--
Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer!
Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer
Reply | Threaded
Open this post in threaded view
|

Re: solr setup

maustin
Try starting Tomcat from your /var/lib/tomcat5/ folder. While in that
folder, run "/etc/init.d/tomcat5 start".  I think I had a similar issue and
it was because I started tomcat in the wrong folder.

mike
Reply | Threaded
Open this post in threaded view
|

Re: solr setup

Yonik Seeley
In reply to this post by Marcus Stratmann
On 3/28/06, Marcus Stratmann <[hidden email]> wrote:
> Well, there's no bin in my tomcat5 directory.

Perhaps the Tomcat distribution looks different because it's bundled
with your OS and they moved stuff around.

>I start tomcat
> using "/etc/init.d/tomcat5 start". May this be a problem?

It could be a problem... it depends what that start script does.

Solr looks in the current working directory for the solrconf
directory, so it depends where that ends up when tomcat is started.

It might be easier to download a recent Tomcat 5.5 distribution and
get it working with that first... then try with the bundled version of
Tomcat once you understand how everything works.


-Yonik
http://incubator.apache.org/solr Solr, The Open Source Lucene Search Server
Reply | Threaded
Open this post in threaded view
|

Re: solr setup

Marcus Stratmann
> Solr looks in the current working directory for the solrconf
> directory, so it depends where that ends up when tomcat is started.
Meanwhile I found out that tomcat is located in /usr/share/tomcat5 and
that there is a bin-directory in it, which I was searching for. A
handfull of links are pointing to /var/lib/tomcat5 which I found
first. So this time I started tomcat using the ./bin/startup.sh as
recommended (had to set some environment variables first) but still
got an error messages. However, this time a different one:

javax.servlet.ServletException
        org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
        org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
        org.apache.jsp.admin.index_jsp._jspService(index_jsp.java:262)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoClassDefFoundError
        org.apache.jsp.admin.index_jsp._jspService(index_jsp.java:67)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


At this point I gave up and tried a new approach. I changed configDir
in Config.java to "/var/lib/tomcat5/solrconf/" (this is where I placed
the configuration) and compiled the whole thing. I'm not sure, if this
really could work (could it?) and in fact it didn't. But I think that
the problem is not the location of the configuration files, but
something different. What do these Security and Privilege messages
mean showing up in the error message?

java.lang.ExceptionInInitializerError
        org.apache.solr.update.SolrIndexConfig.<clinit>(SolrIndexConfig.java:34)
        org.apache.solr.core.SolrCore.<clinit>(SolrCore.java:71)
        org.apache.jsp.admin.index_jsp._jspService(index_jsp.java:67)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:585)
        org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        java.security.AccessController.doPrivileged(Native Method)
        javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
        org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)


> It might be easier to download a recent Tomcat 5.5 distribution and
> get it working with that first... then try with the bundled version of
> Tomcat once you understand how everything works.
Thanks Yonik, maybe I should try that, though I now think that the
configuration is not the main problem.

Btw, I don't like the way the config-files are handled. Searching them in
the webapps-dir is not very elegant, I think. Instead they should be
in /etc/solr or something (for linux; sorry, don't know if there's a
common place where configs are placed under windows or other OSs).

This will become a problem for me anyway because I'm planing to have
three independent indexes which should be operated by three servlets. If
my approach changing the variable configDir worked, this would really
be fine. This way I could create three war-files containing different
locations for the config (and yes, this wouldn't work with my proposed
"elegant" way of putting everything to /etc/solr). Is this approach
correct or do I have to make changes to the code elsewhere?

Thanks,
Marcus


Reply | Threaded
Open this post in threaded view
|

Re: solr setup

Yonik Seeley
> > It might be easier to download a recent Tomcat 5.5 distribution and
> > get it working with that first... then try with the bundled version of
> > Tomcat once you understand how everything works.
> Thanks Yonik, maybe I should try that, though I now think that the
> configuration is not the main problem.

It may be Tomcat configuration/security set up by default on your
Linux distribution.
If you start from a normal tomcat distribution, we will be able to
eliminate that difference.

> Btw, I don't like the way the config-files are handled. Searching them in
> the webapps-dir is not very elegant, I think.

It's searching off the current-working-directory (which also isn't
super elegant).

> Instead they should be
> in /etc/solr or something (for linux; sorry, don't know if there's a
> common place where configs are placed under windows or other OSs).

Even on linux, that would require root, and prevent multiple people
from even trying out Solr on the same box.  We needed a simple way to
find config files without requiring user configuration.

We're thinking of adding a solr.home java system property that would
point to the solr directory.
If we need to support multiple webapps, perhaps the property could
have the webapp name as part of it's name.

> This will become a problem for me anyway because I'm planing to have
> three independent indexes which should be operated by three servlets. If
> my approach changing the variable configDir worked, this would really
> be fine. This way I could create three war-files containing different
> locations for the config (and yes, this wouldn't work with my proposed
> "elegant" way of putting everything to /etc/solr). Is this approach
> correct or do I have to make changes to the code elsewhere?

I don't think there is currently a way to do this.  If you have any
ideas (or even better, a patch) let us know.

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

Re: solr setup

Marcus Stratmann
Yonik Seeley wrote:
> If you start from a normal tomcat distribution, we will be able to
> eliminate that difference.

Yes, I finally got Solr working with Tomcat.
But there are still two minor problems.
The first appears when I try to get the statistics page.
I'm getting this error message:

org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 18 in the jsp file: /admin/stats.jsp
Generated servlet error:
/var/lib/tomcat5/work/Catalina/localhost/solr/org/apache/jsp/admin/stats_jsp.java:106: for-each loops are not supported in -source 1.3
(try -source 1.5 to enable for-each loops)
for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) {

I guess it's a Tomcat problem, but I don't know where it comes
from and what I can do. I'm using Tomcat 5.0.30 (from debian
testing) with the latest solr.war.


The second problem arises when I call the function "Set Level" in the
"Logging" menu. The error message is

exception

org.apache.jasper.JasperException
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:860)

root cause

java.lang.NullPointerException
        java.io.File.<init>(File.java:194)
        org.apache.jsp.admin.action_jsp._jspService(action_jsp.java:132)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:860)


Well, I don't really need this function, so just take it as an error
report.

Marcus


Reply | Threaded
Open this post in threaded view
|

Re: solr setup

Yonik Seeley
On 5/5/06, Marcus Stratmann <[hidden email]> wrote:

> Yonik Seeley wrote:
> > If you start from a normal tomcat distribution, we will be able to
> > eliminate that difference.
>
> Yes, I finally got Solr working with Tomcat.
> But there are still two minor problems.
> The first appears when I try to get the statistics page.
> I'm getting this error message:
>
> org.apache.jasper.JasperException: Unable to compile class for JSP
> An error occurred at line: 18 in the jsp file: /admin/stats.jsp
> Generated servlet error:
> /var/lib/tomcat5/work/Catalina/localhost/solr/org/apache/jsp/admin/stats_jsp.java:106: for-each loops are not supported in -source 1.3
> (try -source 1.5 to enable for-each loops)

It looks like Tomcat 5.0 doesn't support Java5 in JSPs (out-of-the-box
at least).
Could you try the latest Tomcat 5.5?  It worked fine for me.

You don't need an official package for your OS... it's easiest to
simply download the latest directly from apache, unpack it, and go!
(no installation is necessary, you just need to have Java5 in your
path).

http://tomcat.apache.org/download-55.cgi#5.5.17


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

Re: solr setup

Chris Hostetter-3
In reply to this post by Marcus Stratmann

: I'm getting this error message:
:
: org.apache.jasper.JasperException: Unable to compile class for JSP
: An error occurred at line: 18 in the jsp file: /admin/stats.jsp
: Generated servlet error:
: /var/lib/tomcat5/work/Catalina/localhost/solr/org/apache/jsp/admin/stats_jsp.java:106: for-each loops are not supported in -source 1.3
: (try -source 1.5 to enable for-each loops)
: for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) {

This is an issue with TomCat trying to compile the JSPs using Java1.3 --
but Solr requires that it be compiled and run using Java1.5.

I'm notsure why TomCat choose to make hte default 1.3, but you can change
by setting the compilerSourceVM and compilerTargetVM values in your
server config.  They are documented here...

http://tomcat.apache.org/tomcat-5.0-doc/jasper-howto.html#Configuration

: java.lang.NullPointerException
:         java.io.File.<init>(File.java:194)
:         org.apache.jsp.admin.action_jsp._jspService(action_jsp.java:132)

That was definitely a Solr bug.  Chaning the log level uses the
same JSP as togglging the "health check" status -- and that JSP wanted to
make a File object out of the healthCheck file name ... even if there
wasn't one.

I've commited a fix.




-Hoss