0

私の ear アプリケーションは、ローカル ウィンドウ PC 上の Tomcat 6 では問題なく動作しますが、同じ PC 上の Weblogic サーバー 10.3.6 では実行できません。

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.....

以下はpom.xml、問題に関連している可能性のある私の一部です。

<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>
4

1 に答える 1

1

Web アプリケーションの/WEB-INF/libフォルダーから、Tomcat 固有のライブラリ (.xml など) をすべて削除しますel-ri.jar, el-api.jar。これにより、webapp が異なるメーカー/バージョンのコンテナーと互換性がなくなり、この種のエラーが発生します。

詳細については、ここを参照してください

考えられる原因 1:

java.lang.VerifyError実行時に使用しているライブラリとは異なるライブラリに対してコンパイルした場合の結果になる可能性があります。

ここを参照java.lang.VerifyError が発生する原因

考えられる原因 2:

javax.servlet API を Eclipse プロジェクトにインポートするにはどうすればよいですか?

特にこの段落を読む

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.

于 2013-11-12T10:49:48.760 に答える