解决Allocate exception for servlet jsp的问题


异常抛出:

严重: StandardWrapper.Throwable
java.lang.VerifyError: (class: org/apache/jasper/compiler/JspRuntimeContext, method: signature: ()V) Incompatible argument to function
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:100)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
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.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
2016-4-21 16:15:54 org.apache.catalina.core.StandardWrapperValve invoke
严重: Allocate exception for servlet jsp
java.lang.VerifyError: (class: org/apache/jasper/compiler/JspRuntimeContext, method: signature: ()V) Incompatible argument to function
at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:100)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1206)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
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.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

1、检查jdk版本,删除编译的文件夹,clean tomcat服务器和project,重新进行编译,如果错误仍然抛出,则说明不是jdk版本的问题。

2、检查pom.xml中jar包引入的版本信息,删除多余无用的jar包。

3、检查jar包冲突:

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
        </dependency>
    该jar在tomcat中存在,如果在pom.xml中配置,则会引起jar包冲突,可删除该配置,如果是一般的web项目,删除项目中引入的这个jar包即可。

发表评论

邮箱地址不会被公开。 必填项已用*标注

昵称 *