I'm trying to index files in a document throug

2019-01-29 08:23发布

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..

标签: java solr lucene
2条回答
Melony?
2楼-- · 2019-01-29 08:50

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?

查看更多
甜甜的少女心
3楼-- · 2019-01-29 08:52

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.

查看更多
登录 后发表回答