使用weblogic部署war项目里,有些项目可以部署,但有些不行,出现以下异常。
异常如下:
An error occurred during activation of changes, please see the log for details.
[HTTP:101064][WebAppModule(TrafficFront:TrafficFront)] Error parsing descriptor in Web appplication "/home/weblogic/deploy/TrafficFront" weblogic.application.ModuleException: Unmarshaller failed at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:781) at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:272) at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176) at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93) at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360) at
解决方法:
问题出现在项目的web.xml文件的声明部分把原来:
- <web-app version="2.5"
- xmlns="http://java.sun.com/xml/ns/javaee
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
改成:
- <web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
- http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
问题就可以解决了。
--转自