部署描述符异常:was版本和servlet版本问题

  昨天有一个接口项目,由于服务器采购方面的原因,需要将原来部署在was7.0上的ear程序包迁移到was6.0的环境上进行测试,由于我的开发环境一直都是用was6.0进行开发测试的,所以觉得问题应该不大,就让现场的同事部署去了。

  没过多久,错误信息就发过来了。


  日志如下:

[13-9-29 11:13:39:363 CST] 00000047 SystemErr     R com.ibm.etools.j2ee.commonarchivecore.exception.DeploymentDescriptorLoadException: IWAE0022E 为 EAR 文件“/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/wstemp/0/upload/exsap2.ear”中的模块“exsapIntegrateWeb.war”装入部署描述符时发生了异常
!Stack_trace_of_nested_exce!
com.ibm.etools.j2ee.commonarchivecore.exception.DeploymentDescriptorLoadException: WEB-INF/web.xml
!Stack_trace_of_nested_exce!
com.ibm.etools.j2ee.commonarchivecore.exception.ResourceLoadException: IWAE0007E 未能装入归档“exsapIntegrateWeb.war”中的资源“WEB-INF/web.xml”
!Stack_trace_of_nested_exce!
Wrapped exception
org.xml.sax.SAXParseException: 元素类型“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*)”。
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at com.ibm.wtp.internal.emf.xml.util.DOMUtilities.loadDocument(DOMUtilities.java:509)
	at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.loadDocument(EMF2DOMRenderer.java:67)
	at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.doLoad(EMF2DOMRenderer.java:55)
	at com.ibm.wtp.emf.xml.TranslatorResourceImpl.basicDoLoad(TranslatorResourceImpl.java:162)
	at com.ibm.wtp.emf.resource.CompatibilityXMIResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:214)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:884)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java(Compiled Code))
	at com.ibm.wtp.emf.resource.CompatibilityXMIResourceImpl.load(CompatibilityXMIResourceImpl.java:76)
	at com.ibm.wtp.emf.xml.TranslatorResourceImpl.load(TranslatorResourceImpl.java:387)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java(Inlined Compiled Code))
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java(Inlined Compiled Code))
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java(Compiled Code))
	at com.ibm.etools.j2ee.commonarchivecore.strategy.LoadStrategyImpl.getMofResource(LoadStrategyImpl.java:349)
	at com.ibm.etools.j2ee.commonarchivecore.impl.ArchiveImpl.getMofResource(ArchiveImpl.java:891)
	at com.ibm.etools.j2ee.commonarchivecore.impl.ModuleFileImpl.getDeploymentDescriptorResource(ModuleFileImpl.java:256)
	at com.ibm.etools.j2ee.commonarchivecore.strategy.XmlBasedImportStrategyImpl.primLoadDeploymentDescriptor(XmlBasedImportStrategyImpl.java:32)
	at com.ibm.etools.j2ee.commonarchivecore.strategy.War22ImportStrategyImpl.loadDeploymentDescriptor(War22ImportStrategyImpl.java:72)
	at com.ibm.etools.j2ee.commonarchivecore.strategy.War22ImportStrategyImpl.importMetaData(War22ImportStrategyImpl.java:67)
	at com.ibm.etools.j2ee.commonarchivecore.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java(Compiled Code))
	at com.ibm.etools.j2ee.commonarchivecore.impl.WARFileImpl.getStandardDeploymentDescriptor(WARFileImpl.java:296)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:322)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:330)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.rollUpRoles(EARFileImpl.java:785)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.rollUpRoles(EARFileImpl.java:775)
	at com.ibm.websphere.management.application.client.ArchiveDeploymentInfo.(ArchiveDeploymentInfo.java:150)
	at com.ibm.ws.management.application.client.AppInstallHelper.getAppDeploymentInfo(AppInstallHelper.java:215)
	at com.ibm.ws.management.application.client.AppInstallHelper.getAppDeploymentInfo(AppInstallHelper.java:195)
	at com.ibm.websphere.management.application.AppManagementFactory.readArchive(AppManagementFactory.java:88)
	at com.ibm.websphere.management.application.AppManagementFactory.readArchive(AppManagementFactory.java:62)
	at com.ibm.ws.console.appmanagement.action.GatherTaskData.(GatherTaskData.java:108)
	at com.ibm.ws.console.appmanagement.action.DefaultBindingsAction.execute(DefaultBindingsAction.java:228)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:275)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1694)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1643)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
	at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:311)
	at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:185)
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:819)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3189)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:253)
	at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:229)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1970)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:116)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:434)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:373)
	at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1475)
Wrapped by
org.eclipse.emf.common.util.WrappedException: 元素类型“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*)”。
	at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.loadDocument(EMF2DOMRenderer.java:74)
	at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.doLoad(EMF2DOMRenderer.java:55)
	at com.ibm.wtp.emf.xml.TranslatorResourceImpl.basicDoLoad(TranslatorResourceImpl.java:162)
	at com.ibm.wtp.emf.resource.CompatibilityXMIResourceImpl.doLoad(CompatibilityXMIResourceImpl.java:214)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:884)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java(Compiled Code))
	at com.ibm.wtp.emf.resource.CompatibilityXMIResourceImpl.load(CompatibilityXMIResourceImpl.java:76)
	at com.ibm.wtp.emf.xml.TranslatorResourceImpl.load(TranslatorResourceImpl.java:387)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java(Inlined Compiled Code))
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java(Inlined Compiled Code))
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java(Compiled Code))
	at com.ibm.etools.j2ee.commonarchivecore.strategy.LoadStrategyImpl.getMofResource(LoadStrategyImpl.java:349)
	at com.ibm.etools.j2ee.commonarchivecore.impl.ArchiveImpl.getMofResource(ArchiveImpl.java:891)
	at com.ibm.etools.j2ee.commonarchivecore.impl.ModuleFileImpl.getDeploymentDescriptorResource(ModuleFileImpl.java:256)
	at com.ibm.etools.j2ee.commonarchivecore.strategy.XmlBasedImportStrategyImpl.primLoadDeploymentDescriptor(XmlBasedImportStrategyImpl.java:32)
	at com.ibm.etools.j2ee.commonarchivecore.strategy.War22ImportStrategyImpl.loadDeploymentDescriptor(War22ImportStrategyImpl.java:72)
	at com.ibm.etools.j2ee.commonarchivecore.strategy.War22ImportStrategyImpl.importMetaData(War22ImportStrategyImpl.java:67)
	at com.ibm.etools.j2ee.commonarchivecore.impl.WARFileImpl.getDeploymentDescriptor(WARFileImpl.java(Compiled Code))
	at com.ibm.etools.j2ee.commonarchivecore.impl.WARFileImpl.getStandardDeploymentDescriptor(WARFileImpl.java:296)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:322)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.getDeploymentDescriptor(EARFileImpl.java:330)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.rollUpRoles(EARFileImpl.java:785)
	at com.ibm.etools.j2ee.commonarchivecore.impl.EARFileImpl.rollUpRoles(EARFileImpl.java:775)
	at com.ibm.websphere.management.application.client.ArchiveDeploymentInfo.(ArchiveDeploymentInfo.java:150)
	at com.ibm.ws.management.application.client.AppInstallHelper.getAppDeploymentInfo(AppInstallHelper.java:215)
	at com.ibm.ws.management.application.client.AppInstallHelper.getAppDeploymentInfo(AppInstallHelper.java:195)
	at com.ibm.websphere.management.application.AppManagementFactory.readArchive(AppManagementFactory.java:88)
	at com.ibm.websphere.management.application.AppManagementFactory.readArchive(AppManagementFactory.java:62)
	at com.ibm.ws.console.appmanagement.action.GatherTaskData.(GatherTaskData.java:108)
	at com.ibm.ws.console.appmanagement.action.DefaultBindingsAction.execute(DefaultBindingsAction.java:228)
	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:275)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1694)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1643)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
	at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:311)
	at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:185)
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:819)
	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3189)
	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:253)
	at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:229)
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1970)
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:116)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:434)
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:373)
	at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
	at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1475)
Caused by: org.xml.sax.SAXParseException: 元素类型“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*)”。
	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
	at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at com.ibm.wtp.internal.emf.xml.util.DOMUtilities.loadDocument(DOMUtilities.java:509)
	at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.loadDocument(EMF2DOMRenderer.java:67)
	... 57 more

  乍一看是部署文件有问题,检查了下标签顺序,确实有两个标签的位置看似不太对,以为就是这问题了,改完重新发包给现场部署。

  结果,错误依旧。

  同样的程序包,在was7上是能正常运行部署的,而在was6就部署不上去,而且还是报web.xml的错误,估计是跟was版本有关系了。

  翻出以前能正常部署在was6的程序,对比了一下web.xml结构,结果出来了,servlet版本所致。

  目前部署was6有问题的程序,创建动态Web项目是选用的是servlet2.4的版本,可以在was7上正常部署运行;重构了一下程序,改为servlet2.3版本的,结果在was6也能正常部署了。

  结论:看来was6.0不支持servlet2.4。

你可能感兴趣的:(other)