You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Aage Nielsen <an...@openminds.dk> on 2018/06/08 05:18:25 UTC

SoapOutEndingInterceptor fails when exception is thrown

We are struggling with fault handling on an outgoing interceptor. We keep getting 

Caused by: javax.xml.stream.XMLStreamException: No open start element, when trying to write end element
	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1584) [woodstox-core-5.0.3.jar:5.0.3]
	at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1613) [woodstox-core-5.0.3.jar:5.0.3]
	at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteEndTag(BaseNsStreamWriter.java:664) [woodstox-core-5.0.3.jar:5.0.3]
	at com.ctc.wstx.sw.BaseNsStreamWriter.writeEndElement(BaseNsStreamWriter.java:291) [woodstox-core-5.0.3.jar:5.0.3]
	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:304) [cxf-rt-bindings-soap-3.2.4.jar:3.2.4]
When throwing a soapfault from inside our code. We have tried using the cxf demo sample (configuration_interceptor <http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/>) and if we change the 
GZIPOutputStream zipOutput = new GZIPOutputStream(os);
to
GZIPOutputStream zipOutput = new GZIPOutputStream(null);
a soapfault is thrown but fails with the XMLStreamException - any clue would be appreciated.

Venlig hilsen / Best Regards


Aage Nielsen





Openminds
Fredens Torv 1B, 1.
DK-8000 Aarhus C
Denmark
Cvr; 33647166
M: +45 5390 1639
E: ani@openminds.dk <ma...@openminds.dk>
www.openminds.dk <http://www.openminds.dk/>



Re: SoapOutEndingInterceptor fails when exception is thrown

Posted by Colm O hEigeartaigh <co...@apache.org>.
If I modify the configuration_interceptor demo in that way I just get a NPE:

java.lang.NullPointerException
    at
java.util.zip.DeflaterOutputStream.<init>(DeflaterOutputStream.java:84)

---
a/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/interceptor/StreamInterceptor.java
+++
b/distribution/src/main/release/samples/configuration_interceptor/src/main/java/demo/stream/interceptor/StreamInterceptor.java
@@ -56,7 +56,7 @@ public class StreamInterceptor extends
AbstractPhaseInterceptor<Message> {
                 cs.flush();
                 CachedOutputStream csnew = (CachedOutputStream) message
                     .getContent(OutputStream.class);
-                GZIPOutputStream zipOutput = new GZIPOutputStream(os);
+                GZIPOutputStream zipOutput = new GZIPOutputStream(null);

You linked to configuration_interceptor in SVN above - that is no longer
maintained, the CXF source is now in git for several years.

Colm.

On Fri, Jun 8, 2018 at 6:18 AM, Aage Nielsen <an...@openminds.dk> wrote:

> We are struggling with fault handling on an outgoing interceptor. We keep
> getting
>
> Caused by: javax.xml.stream.XMLStreamException: No open start element, when trying to write end element
> 	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1584) [woodstox-core-5.0.3.jar:5.0.3]
> 	at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1613) [woodstox-core-5.0.3.jar:5.0.3]
> 	at com.ctc.wstx.sw.BaseNsStreamWriter.doWriteEndTag(BaseNsStreamWriter.java:664) [woodstox-core-5.0.3.jar:5.0.3]
> 	at com.ctc.wstx.sw.BaseNsStreamWriter.writeEndElement(BaseNsStreamWriter.java:291) [woodstox-core-5.0.3.jar:5.0.3]
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:304) [cxf-rt-bindings-soap-3.2.4.jar:3.2.4]
>
> When throwing a soapfault from inside our code. We have tried using the
> cxf demo sample (configuration_interceptor
> <http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/configuration_interceptor/>)
> and if we change the
>
> GZIPOutputStream zipOutput = new GZIPOutputStream(os);
>
> to
>
> GZIPOutputStream zipOutput = new GZIPOutputStream(null);
>
> a soapfault is thrown but fails with the XMLStreamException - any clue
> would be appreciated.
>
> Venlig hilsen / Best Regards
>
>
> Aage Nielsen
>
>
>
>
>
> *Openminds*
> Fredens Torv 1B
> <https://maps.google.com/?q=Fredens+Torv+1B&entry=gmail&source=g>, 1.
> DK-8000 Aarhus C
> Denmark
> Cvr; 33647166
> M: +45 5390 1639
> E: ani@openminds.dk
> www.openminds.dk
>
>
>


-- 
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com