Newbie with problems getting Solr to run on Tomcat
Hi, I'm quite the newbie when it comes to running Tomcat webapps and the likes of it.. I just need Solr for my website as we have ~45.000 articles we would like a full-text index of. And I have gotten the example "distribution" (solr-nightly/example/) running by modding the schema.xml file.. But since I hardly believe that Getty is suitable for a production env. I tried to move it to Tomcat.. So I installed Tomcat on our "staging"/"test"-server (a copy of our production env. to test stuff out on). It's: Java SDK: `java -version` == java version "1.5.0_06" Tomcat version: `./bin/version.sh`== Version: Apache Tomcat/5.0 Solr-Nightly from solr-2006-09-19.zip When I try to access: testsite.[mycompany].dk/solr/admin/ I get attached error-msg.. I would really appreciate any help, because I would really enjoy using Solr for our searches... Morten Fangel // fangel Denmark 2006-05-15 10:57:45 StandardContext[/solr]Servlet /solr threw load() exception javax.servlet.ServletException: Servlet.init() for servlet SolrServer threw exception at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1085) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4017) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) at org.apache.catalina.core.StandardService.start(StandardService.java:480) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) - Root Cause - java.lang.NoClassDefFoundError at org.apache.solr.servlet.SolrServlet.init(SolrServlet.java:59) at javax.servlet.GenericServlet.init(GenericServlet.java:261) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4017) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277) at org.apache.catalina.core.StandardHost.install(StandardHost.java:832) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) at org.apache.catali
Re: Java heap space
On 5/4/06, I wrote: > From my point of view it looks like this: Revision 393957 works while > the latest revision cause problems. I don't know what part of the > distribution causes the problems but I will try to find out. I think a > good start would be to find out which was the first revision not working > for me. Maybe this would be enough information for you to find out what > had been changed at this point and what causes the problems. (As a reminder, this was a problem with Jetty.) Unfortunately I was not able to figure out what was going on. I compiled some newer revisions from may but my problem with deleting a huge amount of documents did not appear again. Maybe this is because I changed the configuration a bit, adding "omitNorms=true" for some fields. Meanwhile I switched over to tomcat 5.5 as application server and things seem to go fine now. The only situation I get OutOfMemory errors is after an optimize when the server performs an auto-warming of the cahces: SEVERE: Error during auto-warming of key:[EMAIL PROTECTED]:java.lang.OutOfMemoryError: Java heap space (from the tomcat log) But nevertheless the server seems to run stable now with nearly 11 million documents. Thanks to all the friendly people helping me so far! Marcus
Re: Java heap space
On 5/15/06, Marcus Stratmann <[EMAIL PROTECTED]> wrote: The only situation I get OutOfMemory errors is after an optimize when the server performs an auto-warming of the cahces: A single filter that is big enough to be represented as a bitset (>3000 in general) will take up 1.3MB Some ways to help memory: - increase the heap size ;-) - make sure you don't have autowarming for more than one searcher happening at a time. If this happens, you should see something in your logs like "PERFORMANCE WARNING: Overlapping onDeckSearchers=2" - do omitNorms on every field you can... every field with norms will take up 1 byte per document (11MB in your case) - make caches smaller if you can survive the performance hit... A single filter that is represented as a BitSet will take up 1.3MB for 11M docs (and bigger in the case that maxDocs is larger tha numDocs because of deletions). -Yonik
Separate config and index per webapp
I'd like to use Solr for a number of separate projects running on a single Tomcat instance; I thought I would have Solr running a separate webapp for each project. I understand that the default location for the solrconfig.xml and schema.xml files and for the index are under Tomcat's current-working-directory/solr/conf I am hoping I can change the default location for each webapp. Thanks!
Re: Separate config and index per webapp
On 5/15/06, Michael Levy <[EMAIL PROTECTED]> wrote: I'd like to use Solr for a number of separate projects running on a single Tomcat instance; I thought I would have Solr running a separate webapp for each project. I understand that the default location for the solrconfig.xml and schema.xml files and for the index are under Tomcat's current-working-directory/solr/conf I am hoping I can change the default location for each webapp. Thanks! It's not yet possible, but see this thread: http://www.mail-archive.com/solr-dev@lucene.apache.org/msg00298.html It looks like JNDI offers the easiest portable way. The main SolrServlet would then need to be modified to do a JNDI lookup and base config off of that. -Yonik
Re: Separate config and index per webapp
On May 15, 2006, at 3:26 PM, Yonik Seeley wrote: On 5/15/06, Michael Levy <[EMAIL PROTECTED]> wrote: I'd like to use Solr for a number of separate projects running on a single Tomcat instance; I thought I would have Solr running a separate webapp for each project. I understand that the default location for the solrconfig.xml and schema.xml files and for the index are under Tomcat's current-working-directory/solr/conf I am hoping I can change the default location for each webapp. Thanks! It's not yet possible, but see this thread: http://www.mail-archive.com/solr-dev@lucene.apache.org/msg00298.html It looks like JNDI offers the easiest portable way. The main SolrServlet would then need to be modified to do a JNDI lookup and base config off of that. The way I did it is I unpacked the WAR and put my config files into WEB-INF/classes/. Then I individually edit each app's solrconfig.xml and specify a unique path for the index directory. This may not be for everyone, but since I had to unpack the WAR anyway... -MB
Re: Newbie with problems getting Solr to run on Tomcat
that's a little strange ... it looks like it's finding the SolrServlet class but not SolrCore. did you put the solr.war file directly into your webapps directory -- or idd you expand it and move anything arround? the war should work "out of the box" as long as it can find the config files. can you send the output of "find ." from the root directory of your tomcat installation so we can see how you've got your files laid out? : Date: Mon, 15 May 2006 11:05:56 +0200 : From: Morten Fangel <[EMAIL PROTECTED]> : Reply-To: solr-user@lucene.apache.org, [EMAIL PROTECTED] : To: solr-user@lucene.apache.org : Subject: Newbie with problems getting Solr to run on Tomcat : : Hi, : : I'm quite the newbie when it comes to running Tomcat webapps and the likes of : it.. I just need Solr for my website as we have ~45.000 articles we would : like a full-text index of. : : And I have gotten the example "distribution" (solr-nightly/example/) running : by modding the schema.xml file.. But since I hardly believe that Getty is : suitable for a production env. I tried to move it to Tomcat.. : So I installed Tomcat on our "staging"/"test"-server (a copy of our production : env. to test stuff out on). : : It's: : Java SDK: `java -version` == java version "1.5.0_06" : Tomcat version: `./bin/version.sh`== Version: Apache Tomcat/5.0 : : Solr-Nightly from solr-2006-09-19.zip : : When I try to access: testsite.[mycompany].dk/solr/admin/ I get attached : error-msg.. : : I would really appreciate any help, because I would really enjoy using Solr : for our searches... : : Morten Fangel // fangel : Denmark : : -Hoss
Re: Newbie with problems getting Solr to run on Tomcat
I had the same issue some time back. I think the problem is that you need to create solr/conf and solr/data under the tomcat root, not inside "webapps". For instance: TOMCAT HOME = /usr/local/tomcat/ SOLR CONFIG = /usr/local/tomcat/solr/conf/ SOLR DATA = /usr/local/tomcat/solr/data/ SOLR WEBAPP WAR = /usr/local/tomcat/webapps/solr.war On 5/15/06, Chris Hostetter <[EMAIL PROTECTED]> wrote: that's a little strange ... it looks like it's finding the SolrServlet class but not SolrCore. did you put the solr.war file directly into your webapps directory -- or idd you expand it and move anything arround? the war should work "out of the box" as long as it can find the config files. can you send the output of "find ." from the root directory of your tomcat installation so we can see how you've got your files laid out? : Date: Mon, 15 May 2006 11:05:56 +0200 : From: Morten Fangel <[EMAIL PROTECTED]> : Reply-To: solr-user@lucene.apache.org, [EMAIL PROTECTED] : To: solr-user@lucene.apache.org : Subject: Newbie with problems getting Solr to run on Tomcat : : Hi, : : I'm quite the newbie when it comes to running Tomcat webapps and the likes of : it.. I just need Solr for my website as we have ~45.000 articles we would : like a full-text index of. : : And I have gotten the example "distribution" (solr-nightly/example/) running : by modding the schema.xml file.. But since I hardly believe that Getty is : suitable for a production env. I tried to move it to Tomcat.. : So I installed Tomcat on our "staging"/"test"-server (a copy of our production : env. to test stuff out on). : : It's: : Java SDK: `java -version` == java version "1.5.0_06" : Tomcat version: `./bin/version.sh`== Version: Apache Tomcat/5.0 : : Solr-Nightly from solr-2006-09-19.zip : : When I try to access: testsite.[mycompany].dk/solr/admin/ I get attached : error-msg.. : : I would really appreciate any help, because I would really enjoy using Solr : for our searches... : : Morten Fangel // fangel : Denmark : : -Hoss
Re: Newbie with problems getting Solr to run on Tomcat
: I had the same issue some time back. I think the problem is that you need : to create solr/conf and solr/data under the tomcat root, not inside : "webapps". did you really get the same exception becuase tomcat couldn't find your config directory? 2006-05-15 10:57:45 StandardContext[/solr]Servlet /solr threw load() exception javax.servlet.ServletException: Servlet.init() for servlet SolrServer threw exception at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1085) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:876) ... - Root Cause - java.lang.NoClassDefFoundError at org.apache.solr.servlet.SolrServlet.init(SolrServlet.java:59) at javax.servlet.GenericServlet.init(GenericServlet.java:261) ... ...if so that's really bad, i could have sworn Yonik made the code throw good error messages about missing config files a while back, this looks more like a problme of not being able to find the SolrCore class itself (which should be in a jar included in the war file) -Hoss
Re: Newbie with problems getting Solr to run on Tomcat
On 5/15/06, Chris Hostetter <[EMAIL PROTECTED]> wrote: i could have sworn Yonik made the code throw good error messages about missing config files a while back Yeah, as long as people ca see the whole exception chain, the error message should be in there. -Yonik
Re: Separate config and index per webapp
On 5/15/06, Michael Levy <[EMAIL PROTECTED]> wrote: I'd like to use Solr for a number of separate projects running on a single Tomcat instance; I thought I would have Solr running a separate webapp for each project. I understand that the default location for the solrconfig.xml and schema.xml files and for the index are under Tomcat's current-working-directory/solr/conf I am hoping I can change the default location for each webapp. Thanks! It's not yet possible, but see this thread: http://www.mail-archive.com/solr-dev@lucene.apache.org/msg00298.html It looks like JNDI offers the easiest portable way. The main SolrServlet would then need to be modified to do a JNDI lookup and base config off of that. I worked around it this way: http://www.mail-archive.com/solr-dev@lucene.apache.org/msg00321.html -- Ken -- Ken Krugler Krugle, Inc. +1 530-210-6378 "Find Code, Find Answers"
fresh start question: exception running the demo - element 'web-app' not found
Hi, Just loaded Solr - running the demo on Win32 (with Jetty) fails with exception: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. Same for both IBM and SUN JVM (1.5) Must be something simple cause didn't see any other complaints on this. Any Ideas? Thanks, Doron --- Detailed exception follows: Extract jar:file:/D:/sft/solr/solr-nightly/example/webapps/solr.war!/ to C:\DOCUME~1\tpowner\LOCALS~1\Temp\Jetty__8983__solr\webapp 14:38:10.769 WARN!! [main] org.mortbay.xml.XmlParser$Handler.error(XmlParser.java:372) >31> [EMAIL PROTECTED] line:8 col:10 : org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. 14:38:10.779 WARN!! [main] org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:519) >12> Configuration error on jar:file:/D:/sft/solr/solr-nightly/example/webapps/solr.war!/ org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) at org.mortbay.xml.XmlParser.parse(XmlParser.java:217) at org.mortbay.xml.XmlParser.parse(XmlParser.java:235) at org.mortbay.jetty.servlet.XMLConfiguration.configureWebApp(XMLConfiguration.java:190) at org.mortbay.jetty.servlet.WebApplicationContext.configureWebApp(WebApplicationContext.java:425) at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:478) at org.mortbay.util.Container.start(Container.java:72) at org.mortbay.http.HttpServer.doStart(HttpServer.java:708) at org.mortbay.util.Container.start(Container.java:72) at org.mortbay.jetty.Server.main(Server.java:460) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.mortbay.start.Main.invokeMain(Main.java:151) at org.mortbay.start.Main.start(Main.java:476) at org.mortbay.start.Main.main(Main.java:94) ---
Re: fresh start question: exception running the demo - element 'web-app' not found
The current build is broken, probably due to the recent Jetty downgrade (to the latest stable 5.1 release). I've already posted about it in solr-dev, and it will be fixed soon. In the meantime, turn off validation of the web.xml in Jetty and things should work. So start the example server like so: java -Dorg.mortbay.xml.XmlParser.NotValidating=true -jar start.jar -Yonik On 5/15/06, Doron Cohen <[EMAIL PROTECTED]> wrote: Hi, Just loaded Solr - running the demo on Win32 (with Jetty) fails with exception: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. Same for both IBM and SUN JVM (1.5) Must be something simple cause didn't see any other complaints on this. Any Ideas? Thanks, Doron --- Detailed exception follows: Extract jar:file:/D:/sft/solr/solr-nightly/example/webapps/solr.war!/ to C:\DOCUME~1\tpowner\LOCALS~1\Temp\Jetty__8983__solr\webapp 14:38:10.769 WARN!! [main] org.mortbay.xml.XmlParser$Handler.error(XmlParser.java:372) >31> [EMAIL PROTECTED] line:8 col:10 : org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. 14:38:10.779 WARN!! [main] org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:519) >12> Configuration error on jar:file:/D:/sft/solr/solr-nightly/example/webapps/solr.war!/ org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242) at javax.xml.parsers.SAXParser.parse(SAXParser.java:375) at org.mortbay.xml.XmlParser.parse(XmlParser.java:217) at org.mortbay.xml.XmlParser.parse(XmlParser.java:235) at org.mortbay.jetty.servlet.XMLConfiguration.configureWebApp(XMLConfiguration.java:190) at org.mortbay.jetty.servlet.WebApplicationContext.configureWebApp(WebApplicationContext.java:425) at org.mortbay.jetty.servlet.WebApplicationContext.doStart(WebApplicationContext.java:478) at org.mortbay.util.Container.start(Container.java:72) at org.mortbay.http.HttpServer.doStart(HttpServer.java:708) at org.mortbay.util.Container.start(Container.java:72) at org.mortbay.jetty.Server.main(Server.java:460) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.mortbay.start.Main.invokeMain(Main.java:151) at org.mortbay.start.Main.start(Main.java:476) at org.mortbay.start.Main.main(Main.java:94) --- -- -Yonik http://incubator.apache.org/solr Solr, the open-source Lucene search server
Documentation?
I was checking around the solr site and pages at apache.org and wasn't finding much. Before jumping into the code, I'd like to get as familiar with solr as I could from existing docs or the like. Can someone point me in the direction? thanks, jeff r.
Re: Documentation?
: I was checking around the solr site and pages at apache.org and wasn't : finding much. Before jumping into the code, I'd like to get as familiar : with solr as I could from existing docs or the like. Can someone point me : in the direction? The best documentation about using Solr is the tutorial... http://incubator.apache.org/solr/tutorial.html The documentation on Solr's internals and developing Query plugins are pretty sparse at the moment. It's on my todo list (hopefull this week) If you want a good chunk of code to sink your teeth into as a starting point, take a look at StandardRequestHandler, and the APIs it uses from other classes. -Hoss