Hit AppDeploymentException when deploy on WebSphere

荒凉一梦 提交于 2019-12-11 09:57:01

问题


I made the war file through eclipse IDE, and when deploy it to WebSphere 6.1, I hit the following error:

The EAR file could be corrupt and/or incomplete. Make sure that the application is at a compatible Java 2 Platform, Enterprise Edition (J2EE) Level for WebSphere Application Server. AppDeploymentException: [null] java.lang.ClassCastException: org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ArchiveImpl incompatible with org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile

I had been searching around so far couldn't fine a workable solution? Any clue would be much appreciated.


回答1:


In WebSphere 6.1, it doesn't support xml schema version 2.5, it only up until 2.4. And take note that the jdk is version 1.5 from IBM version, not SUN. Below is the correct declaration in the web.xml.

<web-app id="WebApp_ID" version="2.4"  xmlns="http://java.sun.com/xml/ns/j2ee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">



回答2:


I saw a very similar error deploying to WebSphere 6.1. In my case the problem was that I created the EAR file manually and I had the content of the EAR in a sub-folder by mistake. Unzip your EAR and check that all config files are at the right level, ie. ./META-INF/application.xml



来源:https://stackoverflow.com/questions/8429132/hit-appdeploymentexception-when-deploy-on-websphere

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!