Check the Solr log on startup - it will explicitly state which lib
directories/files will be used. Make sure they agree with where the DIH jars
reside. Keep in mind that the directory structure of Solr changed - use the
lib from 4.3 solrconfig.
Try to use DIH in the standard Solr 4.3 example first. Then mimic that in
your customization.
-- Jack Krupansky
-----Original Message-----
From: Christian Köhler
Sent: Thursday, May 23, 2013 8:25 AM
To: solr-user@lucene.apache.org
Subject: Solr 4.3 fails to load MySQL driver
Hi,
in my attempt to migrate for m 3.6.x to 4.3.0 I stumbled upon an issue
loading the MySQL driver from the [instance]/lib dir:
Caused by: java.lang.ClassNotFoundException:
org.apache.solr.handler.dataimport.DataImportHandler
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)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:448)
... 18 more
To narrow it down, I use the plain example configuration with the
following changes:
- Add a dataimport requestHandler to example/conf/solrconfig.xml
(copied from a working solr 3.6.x)
- Created example/conf/data-config.xml with
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" ...
and SQL statement (both copied from a working solr 3.6.x)
- placed the current driver "mysql-connector-java-5.1.25-bin.jar" in
example/lib
As to my knowledge the lib dir is included automatically to the path. To
make sure I tried to:
- add <lib dir="./lib" /> to explicit to solrconf.xml
- add absolute path to solrarconf.xml
- changed solr.xml to use <solr persistent="true" sharedLib="lib>
All to no avail.
System Info:
- OpenJDK Runtime Environmentm 1.7.0_19
- Solr 4.3.0
- mysql-connector-java-5.1.25-bin.jar
The same configuration run fine with a solr 3.6.x on the very same machine.
Any help is appreciated!
Cheers
Chris
--
Christian Köhler