You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Liu, Scott" <SL...@netsuite.com> on 2005/04/12 07:40:21 UTC
NullPointerException in parsing when sending attachments
Hi, All,
I mentioned this in a different email. But this is really a separate issue which is worth of getting feedback from Axis experts.
I have a web service (Axis 1.1) to send messages from a client to a server. My web service is of doc/literal. The service worked when there was no attachment. Once I attached a simple text file using a .NET client Axis failed with a NullPointerException in parsing the soap document. The exception happened before it had ever reached the code of attachment processing.
Here is the stacktrace:
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>java.lang.NullPointerException</faultstring>
<detail>
<ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.lang.NullPointerException
at java.io.FilterInputStream.available(FilterInputStream.java:146)
at oracle.xml.jaxp.JXSAXParser.parse(JXSAXParser.java:277) at
org.apache.axis.encoding.DeserializationContextImpl.parse(Deserializatio
nContextImpl.java:243) at
org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538) at
org.apache.axis.Message.getSOAPEnvelope(Message.java:376) at
org.apache.axis.server.AxisServer.invoke(AxisServer.java:318) at
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:854)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.j
ava:339) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Releasab
leResourcePooledExecutor.java:192) at
java.lang.Thread.run(Thread.java:534)</ns1:stackTrace>
</detail>
</soapenv:Fault>
</soapenv:Body>
It looked like that the inputsteam in the call of FileInputSteam.available() was null when there was an attachement. I have attached the soap document in case it helps.
Please share with me if you know what I might have done wrong.
Thanks,
Scott
P.S. the soap document. The XXX is the boundaries.
POST /services/MyPort HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.573) SOAPAction: "add" Content-Type: application/dime Content-Length: 3596 Expect: 100-continue Host: mycompany.com:8888 Cookie: SESSIONID=ac101fae1f43be793154c99648608c109f5d80228d2e
XXXXXXXXXXXXXXXuuid:25abaa6c-606d-4087-8457-5447dbb04477XXXXXXXXhttp://schemas.xmlsoap.org/soap/envelopeXXXXXXXXXXX
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<preferences xmlns="urn:messages.platform.webservices.mycompany.com">
<warningAsError>false</warningAsError>
</preferences>
<wsa:Action>add</wsa:Action>
<wsa:MessageID>uuid:dbf76fd6-dc93-472f-b05d-f2953b2be280</wsa:MessageID>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/03/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:To>http://mycompany.com:8888/services/MyPort</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-2ad9fb9c-f6da-4f5f-b204-adc5d7e803b4">
<wsu:Created>2005-04-11T22:37:52Z</wsu:Created>
<wsu:Expires>2005-04-11T22:42:52Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<add xmlns="urn:messages.platform.webservices.mycompany.com">
<record xmlns:q1="urn:communication.general.webservices.mycompany.com" xsi:type="q1:Message">
<q1:author key="101" />
<q1:recipient key="100" />
<q1:subject>a dime</q1:subject>
<q1:message>msg</q1:message>
<q1:cc>AGrant@christyscatering.com</q1:cc>
<q1:company key="101" />
<q1:incoming>false</q1:incoming>
</record>
</add>
</soap:Body></soap:Envelope>XXXXXX...Xuuid:9857941b-4892-467f-b0d0-be9a560f7b15XXXXTextEvolution of Web Services Attachments Technologies...XXXXX