I'm trying to index files in a document through SOLR and lucene..

无人久伴 提交于 2019-12-18 09:39:22

问题


as i said in the title: i am using Java, but when I run the code on Eclipse, i get the following error..

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/analysis/util/ResourceLoader at Indexer.getIndexWriter(Indexer.java:38) at Indexer.rebuildIndexes(Indexer.java:73) at SolrIndexer.main(SolrIndexer.java:23) Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.util.ResourceLoader at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 3 more

The SAD PART: the class org.apache.lucene.analysis.util.ResourceLoader is not available in Lucene 4.0/3.6/4.0-ALPHA. although, there are a few webpages where people are talking about the resourceloader class.

can anyone help me out here? Any help would be appreciated..


回答1:


The common analysers have been move lucene-analyzers-common-X.X.X.jar as a result of LUCENE-2510
Ensure that you have it in your classpath.




回答2:


Looks like this class: org.apache.lucene.analysis.util.ResourceLoader cannot be found. Are you sure that all your required 3rd party libraries are on your class path?

According to this API URL, it seems that the interface is available 4.0.0-Alpha. Maybe you could try to revert to this version and see if it works?



来源:https://stackoverflow.com/questions/13245202/im-trying-to-index-files-in-a-document-through-solr-and-lucene

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!