It looks like you have the InputStream in there, so the question is why didn't the StaxInInterceptor not convert that into an XmlStreamReader. That would be the place to dig in. Breakpoint in the StaxIn and see what it is doing.
Dan On Wednesday, February 01, 2012 8:04:09 PM wintlu wrote: > I am using CXF 2.5.2 > I debugged CXF 2.5.2, I know where the problem is, but I don't know how to > solve this... > > in this method: > http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cxf/cxf-api/2.5.1 > /org/apache/cxf/message/MessageImpl.java#131 > org.apache.cxf.message.MessageImpl.getContent(format) > > 131 public <T> T getContent(Class<T> format) { > 132 for (int x = 0; x < DEFAULT_CONTENTS_LENGTH; x++) { > 133 if (DEFAULT_CONTENTS[x] == format) { > 134 return (T)defaultContents[x]; > 135 } > 136 } > 137 return contents == null ? null : (T)contents.get(format); > 138 } > > *format* value = javax.xml.stream.XMLStreamReader > *DEFAULT_CONTENTS* value = > [interface javax.xml.stream.XMLStreamReader, interface > javax.xml.stream.XMLStreamWriter, class java.io.InputStream, class > java.io.OutputStream, interface java.util.List, class java.lang.Exception, > interface org.w3c.dom.Node, class org.apache.cxf.io.DelegatingInputStream, > class javax.xml.soap.SOAPMessage] > *defaultContents* value = > [null, null, <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body></so > apenv:Body></soapenv:Envelope>, null, null, null, [#document: null], null, > null] > > in the method logic, they retrieve the content if any value in > DEFAULT_CONTENTS equals format param. > the first element in DEFAULT_CONTENTS equals XMLStreamWriter, so the first > element in defaultContents is retrieved, this is null!!! so later in > org.apache.cxf.binding.soap.interceptor.handleMessage(), an > NullPointerException is thrown in this line: int i = xmlReader.next(); > > I don't grasp the logic of the MessageImpl, could you please help? > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/CXF-client-exception-Interceptor-for-XXX-ha > s-thrown-exception-unwinding-now-tp5449373p5449567.html Sent from the > cxf-user mailing list archive at Nabble.com. -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
