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

来源:互联网 发布:批量样本数据生成工具 编辑:程序博客网 时间:2024/05/01 22:19

      我相信客户的变化是随心情的, 我突然接到通知, 系统要在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, 真强啊!!


 

原创粉丝点击