1

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.

huahsin68
  • 6,819
  • 20
  • 79
  • 113
  • 1
    A fair number of hits on Google, did you see those? Also, is your Eclipse project set to use versions of Java and J2EE specs that are compatible with WAS 6.1? http://publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Frovr_specs.html&resultof=%22specifications%22%20%22specif%22%20%22api%22 – dbreaux Dec 08 '11 at 15:07
  • yes, google show me everything, and i have read all of them. I read until page 5 of google search then i give up continue my reading. BTW, I have just found the root cause of this problem. Please refer to my answer below. Thanks for your comment. – huahsin68 Dec 09 '11 at 13:49

2 Answers2

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">
huahsin68
  • 6,819
  • 20
  • 79
  • 113
0

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

Peter Tarlos
  • 731
  • 10
  • 13