I'm running MSSQL Server 2008
I did this: set CLASSPATH= C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\sqljdbc4.jar (I dont know where I can check if this has been executed correctly)
Then when approaching this URL: http://localhost:8983/solr/db/dataimport?command=full-import
Using this data-config.xml:
<dataConfig>
<dataSource driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost:1433;databaseName=wedding" user="sa" password="r00kw0rst" />
<document name="weddinglocations">
<entity name="location" query="select * from locations">
<field column="ID" name="id" />
<field column="TITLE" name="title" />
<field column="CITY" name="city" />
<entity name="location_feature" query="select FEATUREID from location_features where locationid='${location.ID}'">
<entity name="feature" query="select title from features where id = '${location_feature.FEATUREID}'">
<field name="features" column="title" />
</entity>
</entity>
<entity name="location_theme" query="select CATEGORYID from location_themes where locationid='${location.ID}'">
<entity name="theme" query="select title from features where id = '${location_theme.FEATUREID}'">
<field name="cat" column="title" />
</entity>
</entity>
</entity>
</document>
</dataConfig>
I get this in my cygwin error log:
SEVERE: JdbcDataSource was not closed prior to finalize(), indicates a bug -- PO
SSIBLE RESOURCE LEAK!!!
Aug 2, 2010 10:51:28 AM org.apache.solr.core.SolrCore execute
INFO: [db] webapp=/solr path=/dataimport params={command=full-import} status=0 Q
Time=0
Aug 2, 2010 10:51:28 AM org.apache.solr.handler.dataimport.DataImporter doFullIm
port
INFO: Starting Full Import
Aug 2, 2010 10:51:28 AM org.apache.solr.handler.dataimport.SolrWriter readIndexe
rProperties
INFO: Read dataimport.properties
Aug 2, 2010 10:51:28 AM org.apache.solr.update.DirectUpdateHandler2 deleteAll
INFO: [db] REMOVING ALL DOCUMENTS FROM INDEX
Aug 2, 2010 10:51:28 AM org.apache.solr.core.SolrDeletionPolicy onInit
INFO: SolrDeletionPolicy.onInit: commits:num=1
commit{dir=C:\apache-solr-1.4.1\example\example-DIH\solr\db\data\index,s
egFN=segments_n,version=1279027246872,generation=23,filenames=[_l.nrm, _l.tis, _
l.fnm, _l.prx, _l.fdx, segments_n, _l.fdt, _l.frq, _l.tii]
Aug 2, 2010 10:51:28 AM org.apache.solr.core.SolrDeletionPolicy updateCommits
INFO: newest commit = 1279027246872
Aug 2, 2010 10:51:28 AM org.apache.solr.handler.dataimport.DataImporter doFullIm
port
SEVERE: Full Import failed
org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load dr
iver: com.microsoft.sqlserver.jdbc.SQLServerDriver Processing Document # 1
at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAnd
Throw(DataImportHandlerException.java:72)
at org.apache.solr.handler.dataimport.JdbcDataSource.createConnectionFac
tory(JdbcDataSource.java:114)
at org.apache.solr.handler.dataimport.JdbcDataSource.init(JdbcDataSource
.java:62)
at org.apache.solr.handler.dataimport.DataImporter.getDataSourceInstance
(DataImporter.java:304)
at org.apache.solr.handler.dataimport.ContextImpl.getDataSource(ContextI
mpl.java:94)
at org.apache.solr.handler.dataimport.SqlEntityProcessor.init(SqlEntityP
rocessor.java:52)
at org.apache.solr.handler.dataimport.EntityProcessorWrapper.init(Entity
ProcessorWrapper.java:71)
at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilde
r.java:319)
at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.j
ava:242)
at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java
:180)
at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImpo
rter.java:331)
at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.j
ava:389)
at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.ja
va:370)
Caused by: java.lang.ClassNotFoundException: Unable to load com.microsoft.sqlser
ver.jdbc.SQLServerDriver or org.apache.solr.handler.dataimport.com.microsoft.sql
server.jdbc.SQLServerDriver
at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.ja
va:738)
at org.apache.solr.handler.dataimport.JdbcDataSource.createConnectionFac
tory(JdbcDataSource.java:112)
... 11 more
Caused by: org.apache.solr.common.SolrException: Error loading class 'com.micros
oft.sqlserver.jdbc.SQLServerDriver'
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.
java:375)
at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.ja
va:728)
... 12 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLSer
verDriver
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.ClassLoader.loadClassInternal(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:359)
... 13 more
Aug 2, 2010 10:51:28 AM org.apache.solr.update.DirectUpdateHandler2 rollback
INFO: start rollback
Aug 2, 2010 10:51:28 AM org.apache.solr.handler.dataimport.JdbcDataSource finali
ze
SEVERE: JdbcDataSource was not closed prior to finalize(), indicates a bug -- PO
SSIBLE RESOURCE LEAK!!!
Aug 2, 2010 10:51:28 AM org.apache.solr.update.DirectUpdateHandler2 rollback
INFO: end_rollback