简体   繁体   English

我正在尝试通过SOLR和Lucene为文档中的文件建立索引。

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

as i said in the title: i am using Java, but when I run the code on Eclipse, i get the following error.. 正如我在标题中所说:我正在使用Java,但是当我在Eclipse上运行代码时,出现以下错误。

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 线程“ main”中的异常java.lang.NoClassDefFoundError:索引为Indexer.getIndexWriter(Indexer.java:38)的org / apache / lucene / analysis / util / ResourceLoader索引为SolrIndexer.main()的Indexer.rebuildIndexes(Indexer.java:73) SolrIndexer.java:23)原因:java.lang.ClassNotFoundException:org.apache.lucene.analysis.util.ResourceLoader at java.net.URLClassLoader $ 1.run(URLClassLoader.java:202)at java.security.AccessController.doPrivileged (本机方法)在java.net.URLClassLoader.findClass(URLClassLoader.java:190)在java.lang.ClassLoader.loadClass(ClassLoader.java:306)在sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:301) )at java.lang.ClassLoader.loadClass(ClassLoader.java:247)...还有3个

The SAD PART: the class org.apache.lucene.analysis.util.ResourceLoader is not available in Lucene 4.0/3.6/4.0-ALPHA . SAD部分: Lucene 4.0/3.6/4.0-ALPHA没有org.apache.lucene.analysis.util.ResourceLoader类。 although, there are a few webpages where people are talking about the resourceloader class. 但是,在一些网页上人们正在谈论resourceloader类。

can anyone help me out here? 有人可以帮我从这里出去吗? Any help would be appreciated.. 任何帮助,将不胜感激..

The common analysers have been move lucene-analyzers-common-XXXjar as a result of LUCENE-2510 由于LUCENE-2510常见的分析仪已移至lucene-analyzers-common-XXXjar
Ensure that you have it in your classpath. 确保在类路径中有它。

Looks like this class: org.apache.lucene.analysis.util.ResourceLoader cannot be found. 看起来像此类:找不到org.apache.lucene.analysis.util.ResourceLoader 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. 根据 API URL,该接口似乎在4.0.0-Alpha中可用。 Maybe you could try to revert to this version and see if it works? 也许您可以尝试还原到该版本,然后查看它是否有效?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM