java.lang.ClassNotFoundException: org.apache.lucene.index.memory.MemoryIndex

Lucence 5.3.1 高亮显示时异常:


Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getLeafContext(WeightedSpanTermExtractor.java:391)
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extractWeightedTerms(WeightedSpanTermExtractor.java:355)
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:150)
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.extract(WeightedSpanTermExtractor.java:110)
	at org.apache.lucene.search.highlight.WeightedSpanTermExtractor.getWeightedSpanTerms(WeightedSpanTermExtractor.java:518)
	at org.apache.lucene.search.highlight.QueryScorer.initExtractor(QueryScorer.java:219)
	at org.apache.lucene.search.highlight.QueryScorer.init(QueryScorer.java:187)
	at org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:196)
	at org.apache.lucene.search.highlight.Highlighter.getBestFragments(Highlighter.java:156)
	at org.apache.lucene.search.highlight.Highlighter.getBestFragment(Highlighter.java:102)
	at com.accord.utils.Searcher.search(Searcher.java:50)
	at com.accord.utils.Searcher.main(Searcher.java:60)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.index.memory.MemoryIndex
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 12 more

解决方法:

在项目下导入lucene-memory-5.3.1.jar包. 


已标记关键词 清除标记
我的步骤是这样的: 1. 从网站checkout源码 svn co地址 [https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_5_2_1/]( "") 2. cmd 到目录下 执行 ant eclipse 报错 错误信息如下 [ivy:configure] :: loading settings :: file = D:\project\lucene\luncene+solr\luc ene\ivy-settings.xml resolve: [ivy:retrieve] [ivy:retrieve] :: problems summary :: [ivy:retrieve] :::: WARNINGS [ivy:retrieve] module not found: org.apache.uima#Tagger;2.3.1 [ivy:retrieve] ==== local: tried [ivy:retrieve] C:\Users\Administrator\.ivy2\local\org.apache.uima\Tagger\2.3. 1\ivys\ivy.xml [ivy:retrieve] -- artifact org.apache.uima#Tagger;2.3.1!Tagger.jar: [ivy:retrieve] C:\Users\Administrator\.ivy2\local\org.apache.uima\Tagger\2.3. 1\jars\Tagger.jar [ivy:retrieve] ==== shared: tried [ivy:retrieve] C:\Users\Administrator\.ivy2\shared\org.apache.uima\Tagger\2.3 .1\ivys\ivy.xml [ivy:retrieve] -- artifact org.apache.uima#Tagger;2.3.1!Tagger.jar: [ivy:retrieve] C:\Users\Administrator\.ivy2\shared\org.apache.uima\Tagger\2.3 .1\jars\Tagger.jar [ivy:retrieve] ==== public: tried [ivy:retrieve] http://repo1.maven.org/maven2/org/apache/uima/Tagger/2.3.1/Tag ger-2.3.1.pom [ivy:retrieve] ==== maven.restlet.org: tried [ivy:retrieve] http://maven.restlet.org/org/apache/uima/Tagger/2.3.1/Tagger-2 .3.1.pom [ivy:retrieve] -- artifact org.apache.uima#Tagger;2.3.1!Tagger.jar: [ivy:retrieve] http://maven.restlet.org/org/apache/uima/Tagger/2.3.1/Tagger-2 .3.1.jar [ivy:retrieve] ==== sonatype-releases: tried [ivy:retrieve] https://oss.sonatype.org/content/repositories/releases/org/apa che/uima/Tagger/2.3.1/Tagger-2.3.1.pom [ivy:retrieve] -- artifact org.apache.uima#Tagger;2.3.1!Tagger.jar: [ivy:retrieve] https://oss.sonatype.org/content/repositories/releases/org/apa che/uima/Tagger/2.3.1/Tagger-2.3.1.jar [ivy:retrieve] ==== releases.cloudera.com: tried [ivy:retrieve] http://repository.cloudera.com/content/repositories/releases/o rg/apache/uima/Tagger/2.3.1/Tagger-2.3.1.pom [ivy:retrieve] -- artifact org.apache.uima#Tagger;2.3.1!Tagger.jar: [ivy:retrieve] http://repository.cloudera.com/content/repositories/releases/o rg/apache/uima/Tagger/2.3.1/Tagger-2.3.1.jar [ivy:retrieve] ==== rr-snapshot: tried [ivy:retrieve] https://oss.sonatype.org/content/repositories/comcarrotsearch- 1039/org/apache/uima/Tagger/2.3.1/Tagger-2.3.1.pom [ivy:retrieve] -- artifact org.apache.uima#Tagger;2.3.1!Tagger.jar: [ivy:retrieve] https://oss.sonatype.org/content/repositories/comcarrotsearch- 1039/org/apache/uima/Tagger/2.3.1/Tagger-2.3.1.jar [ivy:retrieve] ==== working-chinese-mirror: tried [ivy:retrieve] http://uk.maven.org/maven2/org/apache/uima/Tagger/2.3.1/Tagger -2.3.1.pom [ivy:retrieve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:retrieve] :: UNRESOLVED DEPENDENCIES :: [ivy:retrieve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:retrieve] :: org.apache.uima#Tagger;2.3.1: not found [ivy:retrieve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:retrieve] [ivy:retrieve] :::: ERRORS [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] impossible to acquire lock for org.apache.uima#Tagger;2.3.1 [ivy:retrieve] [ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS BUILD FAILED D:\project\lucene\luncene+solr\build.xml:147: The following error occurred while executing this line: D:\project\lucene\luncene+solr\lucene\build.xml:123: The following error occurre d while executing this line: D:\project\lucene\luncene+solr\lucene\common-build.xml:2232: The following error occurred while executing this line: D:\project\lucene\luncene+solr\lucene\analysis\build.xml:91: The following error occurred while executing this line: D:\project\lucene\luncene+solr\lucene\analysis\build.xml:38: The following error occurred while executing this line: D:\project\lucene\luncene+solr\lucene\common-build.xml:431: impossible to resolv e dependencies: resolve failed - see output for details Total time: 22 minutes 18 seconds 谢了啊
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页