Hi, Le 06/05/2010 00:24, Robert Risley a écrit : > Shouldn't the lib folder be in each /coreX folder
You are right. Moving lib folder directly in the core itself does the trick. But I tought having <cores adminPath="/admin/cores" sharedLib="lib"> in my sol.xml would permit to share jar in the {cores_home}/lib directory between all the cores. Anyways, using each core's lib directory resolved my issue, thank you :) Regards, Johan > > --Robert > > -----Original Message----- > From: Johan Cwiklinski [mailto:johan.cwiklin...@ajlsm.com] > Sent: Wednesday, May 05, 2010 3:23 PM > To: solr-user@lucene.apache.org > Subject: DIH: mysql driver not found > > Hello, > > I have an issue trying to use DataImportHandler on a MySQL database. > > I have settted up a multicore installation, and have something like the > following on my disk: > /solr > /cores > solr.xml > /lib > /mysql-connector-java-5.1.12-bin.jar > /core0 > /conf > /data > /core1 > /conf > /data > > When I try a DIH full import, I get errors saying mysql jdbc's driver > has not been found: > GRAVE: Full Import failed > org.apache.solr.handler.dataimport.DataImportHandlerException: Could not > load driver: com.mysql.jdbc.Driver Processing Document # 1 [...] Caused > by: java.lang.ClassNotFoundException: Unable to load > com.mysql.jdbc.Driver or > org.apache.solr.handler.dataimport.com.mysql.jdbc.Driver > [...] > Caused by: org.apache.solr.common.SolrException: Error loading class > 'com.mysql.jdbc.Driver' > [...] > Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver > > Ok, mysql driver is not in the classpath. But it should... > I've put the jar file into {cores_home}/lib/ and it seems being loaded > at startup: > INFO: Adding 'file:/solr/cores/lib/mysql-connector-java-5.1.12-bin.jar' > to classloader > > > In the core0 solrconfig.xml file, I have something like: > <requestHandler name="/dataimport" > class="org.apache.solr.handler.dataimport.DataImportHandler"> > <lst name="defaults"> > <str name="config">my-jdbc.xml</str> > </lst> > </requestHandler> > > My core0/conf/my-jdbc.xml file looks like: > <?xml version="1.0" encoding="UTF-8" ?> > <dataConfig> > <dataSource type="JdbcDataSource" readOnly="true" > driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/mybase" > user="myuser" password="mypass" /> > <document name="docs"> > <entity name="doc" query="SELECT id, title FROM mytable"/> > </document> > </dataConfig> > > What have I missed, or what do i not understand here? > > Thanks, > Johan