0

我已经尝试了互联网上的所有其他问题和一些教程。一切都以相同的错误结束。找不到类异常。C:\solr我已经在主目录下安装了solr,C:\solr_home并且Tomcat的安装在C:\Tomcat 我已经复制了C:\Tomcat\lib文件夹中的Microsoft驱动程序

C:\solr_home\collection1\conf\solrconfig.xml

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

...

<lib dir="C:/solr/dist/" regex="solr-dataimporthandler-.*\.jar" />

C:\solr_home\collection1\conf\data-config.xml

<dataConfig>
    <dataSource 
        driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
        url="jdbc:sqlserver://PC0815\DBPC0815;databaseName=Sampledocs" 
        user="XXXX"
        password="XXXX" 
    />

    <document>
        <entity name="Docs" query="SELECT FieldId, FieldTitle, FieldContent from Docs">
        <field column="FieldId" name="id" />
        <field column="FieldTitle" name="title" />
        <field column="FieldContent" name="description" />
        </entity>
    </document>
</dataConfig>

我收到以下错误

    HTTP Status 500 - {msg=SolrCore 'collection1' is not available due to init failure: 
    org/apache/solr/util/plugin/SolrCoreAware,trace=org.apache.solr.common.SolrException: 
    SolrCore 'collection1' is not available due to init failure: 
    org/apache/solr/util/plugin/SolrCoreAware at 
    org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:785) at 
    org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:295) at
     org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195) at
     org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.ja
    va:241) at 
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:223) at 
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107) at 
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at 
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:75) at 
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934) at 
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90) at 
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:494) at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
     at 
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:
    632) at 
    org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtoco
    l.java:223) at 
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1592) at 
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1550) at 
    java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at 
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at 
    java.lang.Thread.run(Unknown Source) Caused by: org.apache.solr.common.SolrException: 
    org/apache/solr/util/plugin/SolrCoreAware at org.apache.solr.core.SolrCore.<init>
    (SolrCore.java:834) at org.apache.solr.core.SolrCore.<init>(SolrCore.java:625) at 
    org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:524) at 
    org.apache.solr.core.CoreContainer.create(CoreContainer.java:559) at 
    org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:249) at 
    org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:241) at 
    java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at 
    java.util.concurrent.FutureTask.run(Unknown Source) at 
    java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at 
    java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at 
    java.util.concurrent.FutureTask.run(Unknown Source) ... 3 more Caused by: 
    java.lang.NoClassDefFoundError: org/apache/solr/util/plugin/SolrCoreAware at 
    java.lang.ClassLoader.defineClass1(Native Method) at 
    java.lang.ClassLoader.defineClass(Unknown Source) at 
    java.security.SecureClassLoader.defineClass(Unknown Source) at 
    java.net.URLClassLoader.defineClass(Unknown Source) at 
    java.net.URLClassLoader.access$100(Unknown Source) 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.lang.ClassLoader.loadClass(Unknown 
    Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown 
    Source) at 
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1452) at 
    java.lang.ClassLoader.loadClass(Unknown Source) at 
    java.net.FactoryURLClassLoader.loadClass(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:433) at 
    org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:381) at 
    org.apache.solr.core.SolrCore.createInstance(SolrCore.java:526) at 
    org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:599) at 
    org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:153) at 
    org.apache.solr.core.SolrCore.<init>(SolrCore.java:768) ... 13 more Caused by: 
    java.lang.ClassNotFoundException: org.apache.solr.util.plugin.SolrCoreAware 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.lang.ClassLoader.loadClass(Unknown
     Source) ... 40 more ,code=500}
4

1 回答 1

0

您的问题是 DIH 是一个 contrib 模块,这意味着不包含隐式。我看到你设法解决了你的问题。请看一下: 链接

于 2013-10-09T07:29:01.377 回答