問題描述
正如我在標題中所說:我正在使用 Java,但是當我在 Eclipse 上運行代碼時,出現以下錯誤..
as i said in the title: i am using Java, but when I run the code on Eclipse, i get the following error..
線程main"中的異常 java.lang.NoClassDefFoundError: org/apache/lucene/analysis/util/ResourceLoader在 Indexer.getIndexWriter(Indexer.java:38)在 Indexer.rebuildIndexes(Indexer.java:73)在 SolrIndexer.main(SolrIndexer.java:23)引起:java.lang.ClassNotFoundException:org.apache.lucene.analysis.util.ResourceLoader在 java.net.URLClassLoader$1.run(URLClassLoader.java:202)在 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)在 java.lang.ClassLoader.loadClass(ClassLoader.java:247)... 3 更多
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
SAD 部分:org.apache.lucene.analysis.util.ResourceLoader 類在 Lucene 4.0/3.6/4.0-ALPHA
中不可用.不過,在一些網頁上,人們正在談論 resourceloader 類.
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..
推薦答案
LUCENE-2510
確保你的類路徑中有它.
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.
這篇關于我正在嘗試通過 SOLR 和 lucene 對文檔中的文件進行索引.的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!