0

My ear application runs well on Tomcat 6 on local window PC, but it cannot run on Weblogic server 10.3.6 on the same PC.

Caused By: java.lang.VerifyError: (class: org/springframework/web/servlet/FrameworkServlet, method: processRequest signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Incompatible argument to function

        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
        at java.lang.Class.getDeclaredFields(Class.java:1743)
        at weblogic.j2ee.dd.xml.BaseJ2eeAnnotationProcessor.getFields.....

Below is part of my pom.xml which might be related to the problem.

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
user2982680
  • 979
  • 2
  • 9
  • 16

1 Answers1

1

From your webapp's /WEB-INF/lib folder, remove all Tomcat-specific libraries like el-ri.jar, el-api.jar. It will make your webapp incompatible with containers of a different make/version resulting in this kind of errors.

For more info clear explanation see here

Possible cause 1:

java.lang.VerifyError can be the result when you have compiled against a different library than you are using at runtime.

Refer here Causes of getting a java.lang.VerifyError

Possible cause 2:

How do I import the javax.servlet API in my Eclipse project?

Specially read this paragraph

You should above all never manually copy/download/move/include the individual servletcontainer-specific libraries like servlet-api.jar, jsp-api.jar, el-api.jar, j2ee.jar, javaee.jar, etc. It would only lead to future portability, compatibility, classpath and maintainability troubles, because your webapp would not work when it's deployed to a servletcontainer of a different make/version than where those libraries are originally obtained from.

Community
  • 1
  • 1
Jayasagar
  • 2,046
  • 19
  • 22
  • Great and please go through that given link thoroughly :) . – Jayasagar Nov 12 '13 at 11:07
  • What I really say is please remove all container specific jars from pom.xml . Not at all good idea :(. – Jayasagar Nov 12 '13 at 11:16
  • Please Check your compiled jar versions and runtime jar libraries. There might be mismatch b/w them. Check here for answer http://stackoverflow.com/questions/100107/reasons-of-getting-a-java-lang-verifyerror – Jayasagar Nov 13 '13 at 04:54
  • Sure i will try to help you :) – Jayasagar Nov 13 '13 at 15:01
  • servlet-api compiled version: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: Apache Maven Built-By: edburns Package: Build-Jdk: 1.5.0_06 Extension-Name: servlet-api Specification-Title: A component of the Glassfish Application Server Specification-Vendor: Sun Microsystems Inc Implementation-Title: Implementation-Vendor: Sun Microsystems Inc Implementation-Version: 2.5 – user2982680 Nov 13 '13 at 20:03
  • servlet-api runtime version: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.5 Created-By: R27.3.1-1-85830-1.5.0_11-20070716-1248-windows-ia32 (BEA S ystems, Inc.) Implementation-Vendor: BEA Systems Implementation-Title: Javax Enterprise Servlets Client Capable 1.0 Th u Aug 2 12:41:25 EDT 2007 Implementation-Version: 2.5 Source-Repository-Change-Id: 971320 Source-Repository-URI: p4://p4jrep.bea.com:7999://depot/dev/src/reposi tory/modules Depends-On: Bundle-ManifestVersion: 2 Bundle-SymbolicName: javax.servlet – user2982680 Nov 13 '13 at 20:08
  • (continue for runtime version)Bundle-Name: javax.servlet Bundle-Vendor: BEA Systems Bundle-Version: 1.0.0.0_2-5 Export-Package: javax.servlet;version=2.5,javax.servlet.http;version=2 .5,javax.servlet.resources;version=2.5 – user2982680 Nov 13 '13 at 20:09