Hello,
Have anyone encountered the same weird problem ?
I'm getting NullPointerException from Axis in the following conditions:
1. weblogic 8.1 is configured to use jrockit81sp3_142_04
2. request contains SOAP header with simple element with text value.
Axis sends fault response back without any stack trace , only soap
fault string: java.lang.NullPointerException.
After debugging I found that actual exception happens in:
org.apache.axis.message.MessageElement(1388)
Here is how it can be reproduced:
runtime : Weblogic 8.1 (jrockit81sp3_142_04) , Axis 1.2.1 final
I generated a stubs for default Axis web service "Version" and here is
sample code with request/response snapshots
VersionServiceLocator loc = new VersionServiceLocator();
Version ver = loc.getVersion(new
URL("http://localhost:9999/axis/services/Version"));
((Stub)ver).setHeader("http://localhost:7001/axis/services/Version",
"XXXXXXXXXX", "YYYYYYYYYYY");
ver.getVersion();
-------- REQUEST ----------
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<ns1:XXXXXXXXXX
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="0" xsi:type="soapenc:string"
xmlns:ns1="http://localhost:7001/axis/services/Version"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">YYYYYYYYYYY</ns1:XXXXXXXXXX>
</soapenv:Header>
<soapenv:Body>
<ns2:getVersion
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://axis.apache.org"/>
</soapenv:Body>
</soapenv:Envelope>
-------- RESPONSE ----------
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<detail>
<ns1:hostname
xmlns:ns1="http://xml.apache.org/axis/">client_machine</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>