Solr无法加载驱动程序:sun.jdbc.odbc.JdbcOdbcDriver

时间:2014-09-25 19:57:33

标签: jdbc solr odbc

当我尝试dataimport时,我收到此错误:

  

无法加载驱动程序:sun.jdbc.odbc.JdbcOdbcDriver

这是日志:

Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: sun.jdbc.odbc.JdbcOdbcDriver Processing Document # 1
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:262)
    at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:411)
    at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:483)
    at org.apache.solr.handler.dataimport.DataImportHandler.handleRequestBody(DataImportHandler.java:185)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1962)
    at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: sun.jdbc.odbc.JdbcOdbcDriver Processing Document # 1
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:402)
    at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:315)
    at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:223)
    ... 24 more
Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Could not load driver: sun.jdbc.odbc.JdbcOdbcDriver Processing Document # 1
    at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
    at org.apache.solr.handler.dataimport.JdbcDataSource.createConnectionFactory(JdbcDataSource.java:118)
    at org.apache.solr.handler.dataimport.JdbcDataSource.init(JdbcDataSource.java:66)
    at org.apache.solr.handler.dataimport.DataImporter.getDataSourceInstance(DataImporter.java:383)
    at org.apache.solr.handler.dataimport.ContextImpl.getDataSource(ContextImpl.java:99)
    at org.apache.solr.handler.dataimport.SqlEntityProcessor.init(SqlEntityProcessor.java:53)
    at org.apache.solr.handler.dataimport.EntityProcessorWrapper.init(EntityProcessorWrapper.java:74)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:419)
    at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:400)
    ... 26 more
Caused by: java.lang.ClassNotFoundException: Unable to load sun.jdbc.odbc.JdbcOdbcDriver or org.apache.solr.handler.dataimport.sun.jdbc.odbc.JdbcOdbcDriver
    at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:905)
    at org.apache.solr.handler.dataimport.JdbcDataSource.createConnectionFactory(JdbcDataSource.java:116)
    ... 33 more
Caused by: org.apache.solr.common.SolrException: Error loading class 'sun.jdbc.odbc.JdbcOdbcDriver'
    at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:490)
    at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:421)
    at org.apache.solr.handler.dataimport.DocBuilder.loadClass(DocBuilder.java:895)
    ... 34 more
Caused by: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
    at java.net.URLClassLoader$1.run(Unknown Source)
    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:474)
    ... 36 more

我在哪里可以找到这个驱动程序将它放在C:\solr-4.9.0\example\solr\lib中,因为我的solr实例位于上一个路径solr的子文件夹中。

2 个答案:

答案 0 :(得分:2)

  

是的,它是Java 8.

JDBC-ODBC Bridge已从Java 8中删除。

  

我试图为mdb搜索jdbc驱动程序,但我找不到它。那我在哪里可以得到它?

您可以使用UCanAccess。有关更多信息,请参阅

Manipulating an Access database from Java without ODBC

答案 1 :(得分:0)

您需要将更新的jdbc驱动程序安装到托管solr的电脑中。