weblogic与axis2 jar包冲突
1、org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx
[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' CreditLogon:88 org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) Caused by: java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
解决方案一:
报错原因是jar包冲突;复制自己项目中axiom相关jar 包到weblogic domains下的lib目录,必须在lib下新建目录放jar包(不知道为什么。。。);如果weblogic还部署其他项目可能会与其他项目造成jar包冲突。或者 在项目WEB-INF路径下,添加weblogic.xml,内容如下;
<?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" 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/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd"> <jsp-descriptor> <!-- 每隔一段时间检查一次jsp,如果发现变更则自动加载。 --> <page-check-seconds>30</page-check-seconds> </jsp-descriptor> <container-descriptor> <!-- 每隔一段时间检查一次servlet,如果发现变更则自动加载。 --> <servlet-reload-check-secs>30</servlet-reload-check-secs> <!-- 每隔一段时间检查一次资源文件,如果发现变更则自动加载。 --> <resource-reload-check-secs>30</resource-reload-check-secs> <!-- 优先加载部分类,用于解决jar包冲突。 --> <prefer-application-packages> <!-- <package-name>javax.servlet.*</package-name> --> <package-name>org.apache.commons.lang.*</package-name> <package-name>org.apache.xmlbeans.*</package-name> <package-name>antlr.*</package-name> <package-name>javax.persistence.*</package-name> <package-name>org.hibernate.*</package-name> </prefer-application-packages> </container-descriptor> </weblogic-web-app>
2、nested exception is java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx
ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' CreditLogon:88 org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at cn.com.yitong.framework.servlet.SpringDispatcherServlet.doService(SpringDispatcherServlet.java:32) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
Caused by: java.lang.NoClassDefFoundError: org/apache/axiom/soap/impl/builder/OMMetaFactoryEx
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
解决方案:解决方案同上
3、Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.apache.axiom.om.OMAbstractFactory
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.apache.axiom.om.OMAbstractFactory at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
解决方案:解决方案同上
4、weblogic.management.ManagementException: [Deployer:149164]The domain edit lock is owned by another session in exclusive mode - hence this deployment operation cannot proceed.
weblogic.management.ManagementException: weblogic.management.ManagementException: [Deployer:149164]The domain edit lock is owned by another session in exclusive mode - hence this deployment operation cannot proceed. at weblogic.management.deploy.ApplicationsDirPoller.doActivate(ApplicationsDirPoller.java:246) at weblogic.management.deploy.GenericAppPoller.doit(GenericAppPoller.java:275) at weblogic.management.deploy.ApplicationsDirPoller.<init>(ApplicationsDirPoller.java:97) at weblogic.management.deploy.ApplicationsDirPoller.<init>(ApplicationsDirPoller.java:107) at weblogic.management.deploy.internal.DeploymentServerService.startAutoDeploymentPoller(DeploymentServerService.java:322) Truncated. see log file for complete stacktrace
解决方案:
此问题是后台已经有weblogic在运行,去domain/bin下结束掉weblogic重新启动就好;
5、org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 23 in XML document from class path resource [spring-mvc.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cos-all-limited.1.
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 23 in XML document from class path resource [spring-mvc.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cos-all-limited.1.2: An ''all'' model group must appear in a particle with '{'min occurs'}'='{'max occurs'}'=1, and that particle must be part of a pair which constitutes the '{'content type'}' of a complex type definition. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) Caused by: org.xml.sax.SAXParseException: cos-all-limited.1.2: An ''all'' model group must appear in a particle with '{'min occurs'}'= '{'max occurs'}'=1, and that particle must be part of a pair which constitutes the '{'content type'}' of a complex type definition. at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:267) at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
解决方案:
依然是jar包冲突;比较domain下lib文件夹和项目中解析xml的jar包;干掉一个;
6、'weblogic.kernel.Default (self-tuning)' StAXDialectDetector:282 [Weblogic's StAX implementation is unsupported and some Axiom features will not work as expected! Please use Woodstox instead.
[WARN]-[2016-07-26 18:03:02.381] [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' StAXDialectDetector:282 [Weblogic's StAX implementation is unsupported and some Axiom features will not work as expected! Please use Woodstox instead.]
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.apache.axiom.om.impl.OMNodeEx.setParent(Lorg/apache/axiom/om/OMContainer;)V at org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1259) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
解决方案:
weblogic不支持axiom;复制Woodstox到domain lib下;
但是axis2好像只能用axion,无解啊;已经CXF框架并删除项目中的axis2所有jar包;以上所有问题一次性解决;