NullPointerException in internalSerializeAndConsume
---------------------------------------------------
Key: AXIS2-4809
URL: https://issues.apache.org/jira/browse/AXIS2-4809
Project: Axis2
Issue Type: Bug
Components: om
Affects Versions: 1.4
Environment: A centralized server hosting the web -service, with
multiple clients consuming the same. JAVA 1.6 runtime.
Reporter: Srijith Kochunni
Priority: Critical
We invoke one of our our web services using Axis2, without any databinding,
because the response payload might be too huge. This is how we invoke the same.
clientOptions = new Options();
clientOptions.setCallTransportCleanup(true);
clientOptions = setReuseHTTPClient(clientOptions);
EndpointReference targetEPR = new
EndpointReference(endpointURI);
clientOptions.setTo(targetEPR);
clientOptions.setAction(wsAction);
setHTTPKeepAlive(clientOptions, keepAlive);
ServiceClient svcClient = new ServiceClient();
svcClient.setOptions(clientOptions);
result = svcClient.sendReceive(requestOmElement);
The request OM Element is derived from the Adb generated source code, from the
WSDL. It was working correctly for quite some time, but recently randomly it is
seen that we get this following exception
java.lang.NullPointerException
at
org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:664)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:918)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:947)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:240)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:228)
at
org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:947)
at
org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:471)
at
org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
at
org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at
org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:364)
at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:208)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:548)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528)
Following this we looked into the Axiom sources as well, and see that in
OMSourcedElementImpl, the dataSource is becoming null for some reason. We are
creating a new datasource and in our auto-generated code, we could see that the
data Source is set in the request OMElement
public org.apache.axiom.om.OMElement getOMElement (
final javax.xml.namespace.QName parentQName,
final org.apache.axiom.om.OMFactory factory) throws
org.apache.axis2.databinding.ADBException{
org.apache.axiom.om.OMDataSource dataSource =
new
org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){
public void
serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter
xmlWriter) throws javax.xml.stream.XMLStreamException {
GetLocationsRequest.this.serialize(MY_QNAME,factory,xmlWriter);
}
};
return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl(
MY_QNAME,factory,dataSource);
}
This issue has become very critical for us and any help / ideas /
patches would be much appreciated. We had posted the same on Axis-user mailing
list. There have been no responses so far. We are willing to provide any
further information required.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]