1
votes

I am trying to debug solr4.6 source code with eclipse and tomcat. I am getting the error message : HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: Plugin init failure for [schema.xml] fieldType "text_ws": Plugin init failure for [schema.xml] analyzer/tokenizer

I tried debugging it and found that SolrResourceLoader builds the class name as name = base + '.' + subpackage + newName; In case of solr.WhitespaceTokenizerFactory ,base is org.apache.solr , while subpackage name is '' and newName is WhitespaceTokenizerFactory.

So the value for name to fn Class.forName(name,true,classLoader) is org.apache.solr.WhitespaceTokenizerFactory

However the package of WhitespaceTokenizerFactory in solr source is :org.apache.lucene.analysis.core;

Stack Trace :

5200 T22 oasc.SolrException.log ERROR null:org.apache.solr.common.SolrException: SolrCore 'collection1' is not available due to init failure: Plugin init failure for [schema.xml] fieldType "text_ws": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.WhitespaceTokenizerFactory'. Schema file is /usr/share/solr2/example/solr/collection1/schema.xml
        at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:823)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:301)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:201)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:744)
    Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "text_ws": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.WhitespaceTokenizerFactory'. Schema file is /usr/share/solr2/example/solr/collection1/schema.xml
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:608)
        at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:166)
        at org.apache.solr.schema.IndexSchemaFactory.create(IndexSchemaFactory.java:55)
        at org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:69)
        at org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:559)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:597)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:251)
        at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        ... 1 more
    Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "text_ws": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.WhitespaceTokenizerFactory'
        at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:468)
        ... 13 more
    Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.WhitespaceTokenizerFactory'
        at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
        at org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:362)
        at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
        at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:1)
        at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
        ... 14 more
    Caused by: org.apache.solr.common.SolrException: Error loading class 'solr.WhitespaceTokenizerFactory'
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:470)
        at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:573)
        at org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:342)
        at org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:1)
        at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
        ... 18 more
    Caused by: java.lang.ClassNotFoundException: solr.WhitespaceTokenizerFactory
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:270)
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:454)
        ... 22 more
2
do you have the lucene-analyzers-common-4.6.1.jar in your eclipse classpath ?omu_negru
No I was trying to run sorl from source , so did not include any solr/lucene jars. However the issue has been resolved. See the answer by Ajay.artemis

2 Answers

1
votes

Faced a similar issue after setting up solr source code with eclipse and tomcat. I had pointed eclipse compile output directory as webcontent/WEB-INF/classes. To allow tomcat to use the same webcontent directory instead of tomcat publishing to wtp folder enable "serve modules without publishing" in "server options" of tomcat. This will help classloader to locate solr "services" at the right location. Currently the classloader being used for your case is not able to locate the same.

0
votes

I had the same problem. Ajay's answer works good for me. Steps I followed: double click on 'Tomcat at localhost' (or whatever name) in 'servers' view. In server options tick the check box of 'serve modules without publishing.'

REF: Technical details of serve modules without publishing in Eclipse WTP and Tomcat?