아래 에러내용은 weblogic WAS 사용하여 SOAP 통신을 할때 발생하는데
프로그램 소스에는 전혀 이상이 없음에도 parsing 에러가 나면서 안된다.
위에서 설명했듯이 jar 의 충돌에 의해서 인데
weblogic 8.1 에서 webservice.jar 와 saaj.jar 가 충돌이 나서 그렇다.
이때는 saaj.jar 를 먼저 로딩해야되는데 CLASSPATH 설정할때
saaj.jar 를 제일 앞으로 옮기면된다.
AxisFault: 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(Ljava.lang.String;)
Ljavax.xml.soap.SOAPElement;(MessageElement.java:1388)
at org.apache.axis.message.SOAPHandler.addTextNode()V(SOAPHandler.java:148)
at org.apache.axis.message.SOAPHandler.endElement(Ljava.lang.String;
Ljava.lang.String;Lorg.apache.axis.encoding.DeserializationContext;)V(SOAPHandler.java:112)
at org.apache.axis.encoding.DeserializationContext.endElement(Ljava.lang.String;Ljava.lang.String;
Ljava.lang.String;)V(DeserializationContext.java:1087)
at weblogic.apache.xerces.parsers.AbstractSAXParser.endElement(Lweblogic.apache.xerces.xni.QName;
Lweblogic.apache.xerces.xni.Augmentations;)V(AbstractSAXParser.java:585)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Lweblogic.apache.xerces.xni.QName;
Lweblogic.apache.xerces.xni.Augmentations;Z)V(XMLNamespaceBinder.java:898)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(Lweblogic.apache.xerces.xni.QName;
Lweblogic.apache.xerces.xni.Augmentations;)V(XMLNamespaceBinder.java:644)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement()I(Optimized Method)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Z)Z(Optimized Method)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Z)Z(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Z)Z(DTDConfiguration.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(Lweblogic.apache.xerces.xni.parser.XMLInputSource;)V(DTDConfiguration.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(Lweblogic.apache.xerces.xni.parser.XMLInputSource;)V(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(Lorg.xml.sax.InputSource;)V(AbstractSAXParser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(Lorg.xml.sax.InputSource;)V(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(Lorg.xml.sax.InputSource;)V(RegistryXMLReader.java:138)
at javax.xml.parsers.SAXParser.parse(Lorg.xml.sax.InputSource;Lorg.xml.sax.helpers.DefaultHandler;)V(SAXParser.java:345)
How to resolve:
WebLogic 8.1
WebLogic 8.1 ships with webservices.jar that conflicts with Axis' saaj.jar and prevents Axis 1.2 from working right out of the box.
This conflict exists because WebLogic uses an older definition of
javax.xml.soap.* package from Java Web Services Developer Pack Version 1.0,
whereas Axis uses a newer revision from J2EE 1.4.
However, there are two alternative configuration changes
that enable Axis based web services to run on Weblogic 8.1.
* In a webapp containing Axis, set
<prefer-web-inf-classes>
element in WEB-INF/weblogic.xml to true. An example of weblogic.xml is shown below:
<weblogic-web-app>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
If set to true, the <prefer-web-inf-classes> element will
force WebLogic's classloader to load classes located in the WEB-INF
directory of a web application in preference to application or system classes.
This is a recommended approach since it only impacts a single web module.
* In a script used to start WebLogic server, modify CLASSPATH property by
placing Axis's saaj.jar library in front of WebLogic's webservices.jar.
'자바(JAVA)' 카테고리의 다른 글
Vector 생성원리 (0) | 2009.06.22 |
---|---|
Vector 클래스의 추가와 삭제 (0) | 2009.06.13 |
struct 에서 BeanUtils.populate Exception 이 날때 (0) | 2009.06.06 |
local 컴퓨터 IP 정보, 호스트 이름 등을 가져오기 (0) | 2009.06.02 |
apache 에서 제공하는 Common Validator 사용하기 (1) | 2009.05.27 |
spring framework 적용하여 controller 에서 error stacktrace 에러 내용이 찍히지 않을때 (0) | 2009.05.26 |
Locale format 정보을 이용해서 Date outputs 를 원하는 형태로 만들어보자 (0) | 2009.05.19 |
윈도우 OS 에서 돌아가고 있는 프로세스명을 자바로 넘겨받는 방법 (0) | 2009.05.17 |