有一个使用XML技术的项目,其中使用到了ASF的xerces软件包,在J2SE模式下,该程序运行正常,但是当将项目中的类导入了J2EE项目中,部署到Tomcat后无法将JSP页面转换为servlet,出现以下的错误
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: (class: org/apache/xerces/jaxp/DocumentBuilderImpl, method: parse signature: (Lorg/xml/sax/InputSource;)Lorg/w3c/dom/Document;) Incompatible object argument for function call
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.VerifyError: (class: org/apache/xerces/jaxp/DocumentBuilderImpl, method: parse signature: (Lorg/xml/sax/InputSource;)Lorg/w3c/dom/Document;) Incompatible object argument for function call
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:92)
org.apache.jasper.compiler.JspConfig.processWebDotXml(JspConfig.java:76)
org.apache.jasper.compiler.JspConfig.init(JspConfig.java:197)
org.apache.jasper.compiler.JspConfig.findJspProperty(JspConfig.java:249)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:112)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
初步判断是因为类的版本有冲突引起的问题。这个问题困扰了很久也没有解决,后来下载了新的xerces软件包替换了原来的版本,居然问题就解决了。
注意:在更换xerces软件包之后要clean以下项目,否则还会出现这个错误
没有评论:
发表评论