views:

369

answers:

2

Hello,

I'm having trouble installing the LocalSolr component into my Solr setup. I'm running Solr on the following setup:

  • Microsoft Windows Server 2003 R2
  • Apache Tomcat 6

Solr is running great guns.. however when trying to install the LocalSolr i'm getting the following message when trying to go to the Solr Admin Page:

Dec 8, 2009 10:25:32 AM org.apache.solr.common.SolrException log SEVERE: java.lang.NoClassDefFoundError: org/apache/lucene/spatial/tier/DistanceFilter at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:257) at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:278) at org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:83) at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:140) at org.apache.solr.core.SolrCore.loadSearchComponents(SolrCore.java:741) at org.apache.solr.core.SolrCore.(SolrCore.java:439) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:119) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:69) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:850) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:724) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:493) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583) 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:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.ClassNotFoundException: org.apache.lucene.spatial.tier.DistanceFilter 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 java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:592) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 37 more

Does anyone have any experience getting LocalSolr installed on a Solr Box that knows some tweaks I can do to get this to work?

Edit

Blogged: installing LocalSolr onto windows box: http://craftyfella.blogspot.com/2009/12/installing-localsolr-onto-solr-14.html

Hope it helps :)

+2  A: 
java.lang.NoClassDefFoundError: org/apache/lucene/spatial/tier/DistanceFilter

A NoClassDefFoundError basically means that the mentioned class is missing in the runtime classpath, while it was available in the classpath during compiletime of the API in question (that is the difference with ClassNotFoundException).

To solve this problem you obviously need to place the mentioned class (or the JAR file which includes the mentioned class) in the runtime classpath.

As the package name already hints, this concerns Apache Lucene which is available at http://lucene.apache.org. Do you have its libraries in the runtime classpath? If so, are you sure that there are no collisions between duplicated classes/jars of different versions spreading over the classpath (i.e. in WEB-INF/lib, Appserver/lib and JRE/lib) which might be loaded by different classloaders? That can namely also cause this kind of errors.

BalusC
Cheers.. I found a post mentioning that you have to add the missing jar files. I can now get to the Admin page.. unfortunately for me i now get a null java.lang.NullPointerException when trying to do a search.. I'll mark the Question as answered though.
CraftyFella
You're welcome. A `NullPointerException` is by the way fairly easy to fix. Just do `if (object == null) object = new Object()` or `if (object != null) object.doSomething();` :)
BalusC
Thing is.. I'm never used java.. c# all the way... I'm a Next, Next, Next, Finish typical windows user.. So all this config stuff is very frustrating. I just want Solr and LocalSolr to work together.. Not debug the code. Thanks anyway.. I think i'll have to do a hello world app and try and install it on Apache.. Then i think i should be able to start debugging their code.
CraftyFella
+1  A: 

LocalSolr is still pretty bleeding edge stuff, however I am successfully using this "Batteries included Demo".

It was posted as a link on the SOLR-733 issue for Solr JIRA that tracks incorporating LocalSolr into Solr: http://issues.apache.org/jira/browse/SOLR-773?focusedCommentId=12781094&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12781094

Hopefully that works for you, it did for me right out of the box, using the directions at http://www.gissearch.com/localsolr.

Eric Pugh
Awesome.. out of the box sounds good.. so i'll give it a try and feed back to you.
CraftyFella
Ahh it's you.. I totally read your book.. helped me out loads. Page 194 LocalSolr component.
CraftyFella