lucene、SOLR版本升级时候遇到的问题

   今天公司项目升级,从SOLR1.4升级到3.6,所有JAR包,配置文件都修改完成部署后,在solr的Analysis进行分词效果查看时,报了一个异常:
  
   SEVERE: org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.lucene.analysis.TokenStream.next()Lorg/apache/lucene/analysis/Token;
        at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:500)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:283)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)
Caused by: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.lucene.analysis.TokenStream.next()Lorg/apache/lucene/analysis/Token;
        at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:865)
        at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:794)
        at org.apache.jsp.admin.analysis_jsp._jspService(analysis_jsp.java:724)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
        ... 23 more
Caused by: java.lang.NoSuchMethodError: org.apache.lucene.analysis.TokenStream.next()Lorg/apache/lucene/analysis/Token;
        at org.apache.jsp.admin.analysis_jsp.getTokens(analysis_jsp.java:118)
        at org.apache.jsp.admin.analysis_jsp._jspService(analysis_jsp.java:695)
        ... 26 more
   

  经过一番调试和思考,发现是tomcat的work目录下jsp编译成的JAVA文件还是老的版本,删掉重启tomcat即可。

你可能感兴趣的:(Lucene)