我在部署应用程序时使用的是WebSphere AllationServer7.0.0.13版。war是使用Ant版本1.8.2构建的,用于构建war和ear文件。当我通过WebSphere安装我的应用程序时,我遇到以下错误:
EAR文件可能已损坏和/或不完整。确保应用程序处于与当前版本的WebSphere(R)应用程序服务器兼容的Java平台企业版(Java )级别。
com.ibm.websphere.management.application.client.AppDeploymentException根异常是org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DeploymentDescriptorLoadException: dd_in_ear_load_EXC_
我可以知道是什么原因导致这个问题吗?还是我错过了Ant脚本中的配置?下面是编译WAR和EAR的ANT脚本。
<target name="compilewar" description="generating war">
<war destfile="${dist.path}/WebApp.war" webxml="${source.path}/mywebapp/src/main/webapp/WEB-INF/web.xml">
<webinf dir="${source.path}/mywebapp/src/main/webapp/WEB-INF/" includes="**/*"/>
<lib dir="${dist.path}/" includes="*.jar"/>
<classes dir="${source.path}/mywebapp/src/main/resources/" includes="**/*"/>
<fileset dir="${source.path}/mywebapp/src/main/webapp/">
<include name="**/*.jsp"/>
</fileset>
<fileset dir="${source.path}/mywebapp/src/main/webapp/">
<include name="main/**/*"/>
</fileset>
</war>
</target>
<target name="compileear" description="Compile Ear file">
<ear destfile="${source.path}/myear/src/main/application/WebApp.ear" appxml="${svn.working.project.path}application.xml">
<metainf dir="${source.path}/mywebapp/src/main/webapp/META-INF"/>
<fileset dir="${dist.path}/" includes="*.war"/>
</ear>
</target>
THanks @!
发布于 2011-09-09 09:50:03
我已经解决了这个问题。这是由于javac ant任务中缺少源属性造成的。正如源属性的ANT文档中所提到的:
注意,缺省值取决于运行
的JVM。我们强烈建议始终指定此属性。
建议指定要用于编译的java版本。以下是源属性的用法示例:
<javac source="1.6"/>
THanks @!
发布于 2011-09-08 20:47:20
@huahsin68:确保使用WAS JDK编译类,并将其打包为war文件的一部分。如果您也使用ant进行编译,请确保ANT使用WAS JDK作为java环境来运行。
服务器的systemout.log和startServer.log必须提供更多的日志。看看这个。
如果您使用的是eclipse之类的IDE,请将项目遵从性级别设置为J2EE1.5,然后进行清理和重新构建。
发布于 2011-09-08 10:36:29
您似乎正在尝试在支持j2ee EE 5的WAS7中部署Java1.3/1.4兼容的WAR/EAR。检查您的application.xml和web.xml,看看您是否使用了正确的模式版本。还要检查IBM特定的部署描述符。I found this link on WAS support网站。
https://stackoverflow.com/questions/7342509
复制相似问题