0

我正在尝试使用 DIH 从 SQL 服务器导入数据。我遇到了异常。

null:java.lang.NoClassDefFoundError: Could not initialize class org.apache.solr.handler.dataimport.DataImportHandler
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:399)
at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:420)
at org.apache.solr.core.SolrCore.createRequestHandler(SolrCore.java:477)
at org.apache.solr.core.RequestHandlers.initHandlersFromConfig(RequestHandlers.java:154)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:577)
at org.apache.solr.core.SolrCore.<init>(SolrCore.java:504)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:816)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:510)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:333)
at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:282)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:101)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1585)
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)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

请帮我解决这个问题,并告诉我是否有任何其他方法可以在不使用 DataImportHandler 的情况下将数据索引到 solr,或者是否有任何方法可以使用任何 C# 应用程序或类似的东西将数据索引到 solr?

提前致谢。

4

1 回答 1

0

apache-solr-dataimporthandler-x.y.z.jar 和apache-solr-dataimporthandler-extras-x.y.z.jar文件添加到Solr 主目录的libsolrconfig.xml文件夹中,并在文件中配置 lib 目录。

索引数据的另一种方法是使用SolrSharp项目。

于 2012-12-07T11:35:04.650 回答