我正在尝试使用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#app或类似的东西将数据索引到solr?
提前致谢。
答案 0 :(得分:0)
将apache-solr-dataimporthandler-x.y.z
。jar和apache-solr-dataimporthandler-extras-x.y.z.jar
文件添加到Solr home的 lib 文件夹中,并在solrconfig.xml
文件中配置lib目录。
索引数据的另一种方法是使用SolrSharp项目。