paoding+struts java.lang.VerifyError: (class: net/paoding/analysis/kn

CherryAndJeff 2013-10-15 01:14:26
本人菜鸟一枚,最近研究lucene+paoding 想借和struts显示在web上,单独测试没有问题 集成struts后出现以下问题:
java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
....后边还有很多!!
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:722)

java.lang.VerifyError: (class: net/paoding/analysis/knife/PaodingMaker$1, method: run signature: ()V) Incompatible object argument for function call
net.paoding.analysis.knife.PaodingMaker.implMake(PaodingMaker.java:394)
net.paoding.analysis.knife.PaodingMaker.make(PaodingMaker.java:118)
net.paoding.analysis.analyzer.PaodingAnalyzer.init(PaodingAnalyzer.java:73)

''''''''后边还有很多!!!

这是小弟搜索源码(索引已经建立,而且这个方法单独测试没有问题的):

public String search() throws Exception {
File dataFile = new File("F://webPaodingTest//indexFile");
//使用庖丁分词器
Analyzer analyzer = new PaodingAnalyzer();
IndexSearcher isearcher = null;
IndexReader indexReader =null;
Directory directory = null;
FSDirectory dir=null;
try {
dir = SimpleFSDirectory.open(dataFile);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Long end;
Long start = System.currentTimeMillis();
try {
indexReader = IndexReader.open(dir);
/**
* 创建索引搜索器 且只读
*/
isearcher = new IndexSearcher(indexReader);
QueryParser parser = new QueryParser(Version.LUCENE_32, "content", analyzer);
Query query = parser.parse(queryString);
/**
* 执行搜索,获取查询结果集对象
*/
TopDocs topDocs = isearcher.search(query,100);
ScoreDoc[] hits = topDocs.scoreDocs;
System.out.println("中标:"+hits.length);
/**
* 关键字 高亮
*/
Formatter formatter = new SimpleHTMLFormatter("<font color='red'>", "</font>");
Scorer scorer = new QueryScorer(query);
Highlighter highlighter = new Highlighter(formatter, scorer);
/**
* 设置摘取字符的长度,默认为100个字符
*/
Fragmenter fragmenter = new SimpleFragmenter(100);
highlighter.setTextFragmenter(fragmenter);
for(ScoreDoc scoreDoc : hits){
Document hitDoc = isearcher.doc(scoreDoc.doc);
String fileName = hitDoc.get("fileName");
String title = hitDoc.get("title");
resultString = highlighter.getBestFragment(analyzer, "content", hitDoc.get("content"));
web = new Web();
web.setFileName(fileName);
web.setTitle(title);
web.setResultString(resultString);
System.out.println(title);
webs.add(web);
}
} catch (Exception e) {
throw new RuntimeException(e);
} finally {
try {
isearcher.close();
} catch (IOException e) {
e.printStackTrace();
}
}

end = System.currentTimeMillis();
System.out.println("搜索时间:"+(end-start));
return SUCCESS;
}




但求大神指点迷经,小弟必将感激涕淋!!!
...全文
201 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
CherryAndJeff 2013-10-15
  • 打赏
  • 举报
回复
问题解决了!原来是编译版本的原因,换成jdk7 顺利通过!!

2,759

社区成员

发帖
与我相关
我的任务
社区描述
搜索引擎的服务器通过网络搜索软件或网络登录等方式,将Internet上大量网站的页面信息收集到本地,经过加工处理建立信息数据库和索引数据库。
社区管理员
  • 搜索引擎技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧