WAS(websphere) deploy issue:the ear file could be corrupt

Issue happened below when we deploy our app on IBM websphere:

The EAR file could be corrupt and /or imcompleted. Make sure that the application is at a comptible Java 2 Platform, Enterprise Edition(J2EE) Level for WebSphere Application server.

AppDeploymentException:[null]org.eclipse.jst.....

  • 出现以上问题,是由于was在check你的 ear的时候出现的验证不通过。笔者在was6上面deploy。需要使用jdk 1.5来compile code。所以按照IBM以及ant官方的建议,在complie code的task里面specify source版本:

<javac source="1.5" srcdir="src...."/>

  • 如果依然出现上面的error,可以查看ear里面的meta-inf文件夹下面的文件配置是否一致。

例如:我的application叫ws-ss,ear named ws-cn.ear, 那么meta-inf下面有一个application.xml里面的配置也必须要和这个一致。

  • 最后和本体无关的的一个small tip:在daily开发的时候我们经常需要指定ant build使用过的jdk以匹配was支持的jdk版本,但是ant默认使用系统的environment设置,所以通常要修改environment everytime before ant building。其实我们只需要在ant的builx.xml里面specify jdk 就可以让ant用指定的jdk来compile code了:

<javac source="1.5" srcdir="src...." executable="C:\Java\jdk1.5.0_22\bin\javac"/>

猜你喜欢

转载自wsh-88188.iteye.com/blog/2273966