lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "andre.schneider" <andre.schnei...@capitula.de>
Subject DataImportHandler - Custom EventListener
Date Fri, 11 May 2012 12:34:13 GMT
Hi there,
i want to register a custom EventListener to the DataImportHandler, but i
get a NoClassDefFoundError.
My configuration: 
Gentoo Linux.
Solr home is /opt/solr.
The solr.war file is deployed in an existing tomcat at /opt/tomcat/webapps
The solr version is 3.6, tomcat version is 6.0.35, oracle jdk 1.7.0_03.

MyEventListener implements org.apache.solr.handler.dataimport.EventListener. 
It is in a jar file in /opt/solr/myproject/lib. (Here is also the mysql jdbc
driver jar, which can be loaded)

In the solrconfig.xml i added following lib-tags:
<lib dir="/opt/solr/dist/" regex="apache-solr-dataimporthandler-.*\.jar" />
<lib dir="/opt/solr/myproject/lib/" regex=".*\.jar" />

and following DataImportHandler:
<requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
   <lst name="defaults">
      <str name="config">db-data-config.xml</str>
   </lst>
</requestHandler>

The db-data-config.xml looks like:
<dataConfig>
   <dataSource driver="com.mysql.jdbc.Driver" url="..." user="..."
password="..." />
   <document name="mydocuments" onImportEnd="test.MyEventListener">
         <entity name="mydocument" query="SELECT *FROM mydocuments WHERE
valid = true"/>
   </document>
</dataConfig>

But when i run the full-import command, solr imports the documents, but when
it tries to load my EventListener then following Exception is thrown:
Sever: Full Import failed:java.lang.NoClassDefFoundError:
org/apache/solr/handler/dataimport/EventListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        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:423)
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:410)
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:378)
        at
org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:1100)
        at
org.apache.solr.handler.dataimport.DocBuilder.invokeEventListener(DocBuilder.java:158)
        at
org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:251)
        at
org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:375)
        at
org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:445)
        at
org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:426)
Caused by: java.lang.ClassNotFoundException:
org.apache.solr.handler.dataimport.EventListener
        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:423)
        at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        ... 23 more

I have also tried to put the solr jars in a shared lib folder of tomcat, but
with the same error.

Can anybody help?

Thanks a lot in advance.

Best regards,
Andre

--
View this message in context: http://lucene.472066.n3.nabble.com/DataImportHandler-Custom-EventListener-tp3979799.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message