在websphere上部署应用遇到的问题

本文记录了一次在WebSphere上部署应用的经历,详细介绍了如何解决web.xml文件引起的部署问题,包括调整元素顺序、去除非法属性等步骤。

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

      我相信客户的变化是随心情的, 我突然接到通知, 系统要在webshpere上运行, 哈哈哈... -_-

      webshpere长什么样???

      用jar命令将应用打成war包, 部署到webshpere时显示web.xml错误, shit! 由于不确认出错的具体原因, 我将web.xml文件中的内容全部清空, 只留下

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/webapp_2_3.dtd">

<web-app>
</web-app>

      这次部署通过, 问题可以确定是出在web.xml文件上.

      web.xml文件有一大堆servlet之类的标签, 上网搜了一下"web.xml 顺序", 找到一篇文章

Problem(Abstract)
Enterprise application fails to deploy and throws the following exception:
AppDeploymentException:

 com.ibm.etools.archive.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
Symptom
 
 
Cause
The EAR file might be corrupt and/or incomplete.The enterprise application web.xml file must follow the web-app_2_3.dtd standard. In this case, the filter tag is placed after the servlet tag. The filter tag must be placed before the servlet tag.  
  Resolving the problem
The web.xml file must follow the web-app_2_3.dtd order:

<!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

If the application fails to deploy during the upload operation, check the order of elements in the web.xml file and place the tag in the order shown above to avoid the deployment issue.

      看来websphere对web.xml的校验比较严. 我调整了web.xml的顺序, 部署, shit! 还是没通过! 删除了所有注释和空行, 再部署, 依然没有通过. 这次可把我整没招了. 找来高手一起检查, 发现其中一个servlet标签中带有"description"属性, 把这个属性删除, 部署, 这次成功了.我晕, websphere, 真强啊!!


 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值