Websphere deploy war package fail: JVM compatible issue

文章详细介绍了在使用ANT构建工具进行Web应用打包时,出现类文件版本冲突导致的WebSphere应用部署失败问题。通过分析代码配置,发现两个不同途径将类文件复制到目标WAR包中,导致了部署错误。解决方案在于调整ANT配置,确保仅通过一个途径将类文件正确复制到目标目录,避免类文件重复现象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  • Problem:

    com.ibm.websphere.management.application.client.AppDeploymentException: 
    [Root exception is org.eclipse.jst.j2ee.commonarchivecore.internal.exception.SaveFailureException: WEB-INF/classes/com/webspheretools/logview/DisplayRawServlet.class] 

    Solution:

    ANT was copying two versions of each class files .ie one for the webcontent folder (fileset directive) in ANT and another command (classes directive) was also copying the classes to the destination WAR build folder. When the WAR as packaged and deployed as an EAR, Websphere was very unhappy as there were two classes for each artifact, hence the above error.


    <war destfile="${dest.dir}/${package.file}" webxml="${temp.dir}/WebContent/WEB-INF/web.xml" update="true">

    <classes dir="${temp.dir}/WebContent/WEB-INF/classes" />
    <fileset dir="${temp.dir}/WebContent">
    <exclude name="WEB-INF/web.xml" />
    </fileset>

    </war>


    Should have been

    <war destfile="${dest.dir}/${package.file}" webxml="${temp.dir}/WebContent/WEB-INF/web.xml" update="true">

    <fileset dir="${temp.dir}/WebContent">
    <exclude name="WEB-INF/web.xml" />
    </fileset>

    </war>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值