昨天部署应用时才发现问题,应用中新加的Axis做的客户端在WebLogic Server 版本: 10.3.5.0上报错具体的堆栈信息如下:
原文链接:https://www.f2er.com/ajax/165332.html
- 2013-05-1813:23:49,580[TIBCOEMSSessionDispatcher(9350847568)]ERROR[gov.chinapost.ems.ebay.services.impl.OutPartnerServiceImpl]-;nestedexceptionis:
- java.lang.NullPointerException
- AxisFault
- faultCode:{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
- faultSubcode:
- faultString:java.lang.NullPointerException
- faultActor:
- faultNode:
- faultDetail:
- {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
- atorg.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1388)
- atorg.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148)
- atorg.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112)
- atorg.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
- atorg.apache.xerces.parsers.AbstractSAXParser.endElement(UnknownSource)
- atorg.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(UnknownSource)
- atorg.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(UnknownSource)
- atorg.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(UnknownSource)
- atorg.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)
- atorg.apache.xerces.parsers.XML11Configuration.parse(UnknownSource)
- atorg.apache.xerces.parsers.XMLParser.parse(UnknownSource)
- atorg.apache.xerces.parsers.AbstractSAXParser.parse(UnknownSource)
- atorg.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(UnknownSource)
- atorg.apache.xerces.jaxp.SAXParserImpl.parse(UnknownSource)
- atorg.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
- atorg.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
- atorg.apache.axis.Message.getSOAPEnvelope(Message.java:435)
- atorg.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
- atorg.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
- atorg.apache.axis.client.Call.invokeEngine(Call.java:2784)
- atorg.apache.axis.client.Call.invoke(Call.java:2767)
- atorg.apache.axis.client.Call.invoke(Call.java:2443)
- atorg.apache.axis.client.Call.invoke(Call.java:2366)
- atorg.apache.axis.client.Call.invoke(Call.java:1812)
- atcom.ebay.apacshipping.ems.ShippingServiceSoapStub.updateOrderStatus(ShippingServiceSoapStub.java:225)
- atgov.chinapost.ems.ebay.services.impl.OutPartnerServiceImpl.receiveMessage(OutPartnerServiceImpl.java:139)
- atgov.chinapost.ems.msg.adapter.jms.impl.MessageReceiver$1.onMessage(MessageReceiver.java:75)
- atcom.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567)
- atcom.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963)
- atcom.tibco.tibjms.TibjmsSession$Dispatcher.run(TibjmsSession.java:3098)
- {http://xml.apache.org/axis/}hostname:dmz-app-03
2013-05-18 13:23:49,580 [TIBCO EMS Session Dispatcher (9350847568)] ERROR [gov.chinapost.ems.ebay.services.impl.OutPartnerServiceImpl] - ; nested exception is: java.lang.NullPointerException AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.lang.NullPointerException faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException at org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1388) at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148) at org.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.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.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at com.ebay.apacshipping.ems.ShippingServiceSoapStub.updateOrderStatus(ShippingServiceSoapStub.java:225) at gov.chinapost.ems.ebay.services.impl.OutPartnerServiceImpl.receiveMessage(OutPartnerServiceImpl.java:139) at gov.chinapost.ems.msg.adapter.jms.impl.MessageReceiver$1.onMessage(MessageReceiver.java:75) at com.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567) at com.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963) at com.tibco.tibjms.TibjmsSession$Dispatcher.run(TibjmsSession.java:3098) {http://xml.apache.org/axis/}hostname:dmz-app-03虽然在网上找到的有解决办法但是对于我这边服务器来说都不太适合我,因为他们要修改weblogic的启动脚本什么的,毕竟一个weblogic上不可能只部署一个应用,那么多的应用对于我来说是未知的,所以我不能冒险去改公共用的资源,问题的根本原因就是saaj.jar,如果应用中还有其他接口是用axis2做的话(毕竟不是一个人写的每个人都有习惯所以一个应用上有两种Service的方法)应该有geronimo-saaj_1.3_spec-1.0.1.jar包,我的是后者,这个包跟weblogic本身的webservices.jar中的javax.xml.soap包重复,我很奇怪weblogic为什么要把别人的包拷贝到自己的包里面,然后包路径什么都没改,这样就造成了冲突,如果你的应用的weblogic.xml中加的有<prefer-web-inf-classes>true</prefer-web-inf-classes>的话,就表示weblogic会先加载应用中的jar包最后加载自己的jar包,我的是配的true。这个时候我就想到了一个解决办法,把weblogic的webservices.jar包拷贝到我的项目中,然后把包里面的javax.xml.soap给删除掉,这样保证weblogic一定会先加载geronimo-saaj_1.3_spec-1.0.1.jar或saaj.jar包,重新部署,启动就OK了。