You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by priyam_maheshwari <pr...@yahoo.com> on 2011/08/04 10:47:13 UTC

Solr DataImportHandler not found

I am using Solr 3.3.0 with Tomcat 6.0.26. I was able to successfully install
Solr and i was even able to access its web interface using
http:/localhost:8084/solr/admin.

Now i want to use its dataimporthandler to index data from my database.I
have added following to my solrconfig:

<requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImport
 Handler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler> 

I have also created a data-config.xml in same directory.

My solrconfig file has following location for dataimport

  <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" /> 
And i have checked that apache-solr-dataimporthandler-3.3.0.jar file exist
in the dist folder at following path
C:\web\solr\example\lib\apache-solr-3.3.0\dist

But whenever I type http:/localhost:8084/solr/dataimport or
http:/localhost:8084/solr/admin/dataimport it says resource unavailable. I
thought it was due to some problem with Tomcat setting so i stopped tomcat
and tried to start Solr from cmd using java -jar start.jar. And i get the
following error

HTTP ERROR 500
Problem accessing /solr/. Reason:
Severe errors in solr configuration.
Check your log files for more detailed information on what may be wrong.
If you want solr to continue after configuration errors, change: 

<abortOnConfigurationError>false</abortOnConfigurationError>

in solr.xml

-------------------------------------------------------------
org.apache.solr.common.SolrException: Error loading class    
    'org.apache.solr.handler.dataimport.DataImportHandler'
at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:389)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:423)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:459)
at  
 
org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:157)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:563)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:463)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:316)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:207)
at 
  
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:130)
at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:94)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at 
 org.mortbay.jetty.handler.ContextHandlerCollection.doStart
 (ContextHandlerCollection.java:156)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mortbay.start.Main.invokeMain(Main.java:194)
at org.mortbay.start.Main.start(Main.java:534)
at org.mortbay.start.Main.start(Main.java:441)
at org.mortbay.start.Main.main(Main.java:119)
  Caused by: java.lang.ClassNotFoundException:   
  org.apache.solr.handler.dataimport.DataImportHandler
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:373)
... 34 more

Can anybody help me with this please

--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DataImportHandler-not-found-tp3224817p3224817.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr DataImportHandler not found

Posted by celso <et...@gmail.com>.
You must add to your Solrconfig.xml:

*<luceneMatchVersion>LUCENE_33</luceneMatchVersion>*
<lib dir="../../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />

Okay, you put the second code line at your schema, but you need to map your
/dist directory.

For example:
If you are using muticores

C:\solr\example\multicores\core01\conf\
You should do ../../../ to reach /dist directory

But if you using a simple core
C:\solr\example\core\conf\
Just do ../../ to reach /dist directory

btw <lib dir=""> is the /conf dir.

Regards,
Celso
http://www.dosolr.com.br www.dosolr.com.br 


--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-DataImportHandler-not-found-tp3224817p3302696.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr DataImportHandler not found

Posted by Chris Hostetter <ho...@fucit.org>.
: My solrconfig file has following location for dataimport
: 
:   <lib dir="../../dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" /> 
: And i have checked that apache-solr-dataimporthandler-3.3.0.jar file exist
: in the dist folder at following path
: C:\web\solr\example\lib\apache-solr-3.3.0\dist

where are you running solr from?  unless it's something like
C:\web\solr\example\lib\apache-solr-3.3.0\xxx\yyy\ that ../../dist/ isn't 
going to help you find it.

if you look at the log messages when Solr starts up, it will list every 
dir it looks in and every jar it finds based on those <lib> directives and 
i think you'll see thta it's not finding the DIH jars using those 
expressions.

PS: In the future, pelase ask questions about using solr on the 
solr-user@lucene mailing list.



-Hoss