Axis做的Service客户端部署在weblogic上兼容问题

前端之家收集整理的这篇文章主要介绍了Axis做的Service客户端部署在weblogic上兼容问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
昨天部署应用时才发现问题,应用中新加的Axis做的客户端在WebLogic Server 版本: 10.3.5.0上报错具体的堆栈信息如下:


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了。 原文链接:https://www.f2er.com/ajax/166370.html

猜你在找的Ajax相关文章