You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Cristiano Costantini <cr...@gmail.com> on 2016/03/17 14:38:27 UTC

CXF fault prints full stack trace

Hello all,
in a service mix I have an application that publish a web service using the
<jaxws:endpoint /> tag in a spring file.

This web service may throw modeled SOAP Faults, and when it does it
shouldn't print the full stack trace.
When I run the service in the tests (starting a Spring application in a
Spring's ClassPathXmlApplicationContext() ) the body of the fault is empty
like this:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Msg OperationFault</faultstring>
         <detail>
            <ns1:operationFault xmlns:ns1="
http://net.cristcost/ns/service/fault">
               <faultType xsi:type="srvfault:OperationFaultType" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:srvfault="http://net.cristcost/ns/service/fault
">CONSUMER_ERROR</faultType>
            </ns1:operationFault>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>


But when I run the same spring xml file inside servicemix, at every fault
the full server stack trace is printed in many <classContext > tags like
the following:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Msg OperationFault</faultstring>
         <detail>
            <ns1:operationFault xmlns:ns1="
http://net.cristcost/ns/service/fault">
               <faultType xsi:type="srvfault:OperationFaultType" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:srvfault="http://net.cristcost/ns/service/fault
">CONSUMER_ERROR</faultType>
               <classContext xmlns:srvfault="
http://net.cristcost/ns/service/fault
">net.cristcost.test.ExceptionTestService</classContext>
               ....
               <classContext xmlns:srvfault="
http://net.cristcost/ns/service/fault
">org.eclipse.jetty.util.thread.QueuedThreadPool</classContext>
               <classContext xmlns:srvfault="
http://net.cristcost/ns/service/fault">java.lang.Thread</classContext>
            </ns1:operationFault>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>



Anyone knows how to disable this behaviour or at least where in servicemix
to investigate to find a solution?

Re: CXF fault prints full stack trace

Posted by Cristiano Costantini <cr...@gmail.com>.
Hello all,
I've detected the source of this problem, it is due to the endorsed
java.lang.Exception in Karaf:
https://github.com/apache/karaf/blob/master/exception/src/main/java/java/lang/Exception.java

I'm going to file an issue on Karaf and start a discussion on the Karaf
mailing list.

Cristiano

Il giorno gio 17 mar 2016 alle ore 14:38 Cristiano Costantini <
cristiano.costantini@gmail.com> ha scritto:

> Hello all,
> in a service mix I have an application that publish a web service using
> the <jaxws:endpoint /> tag in a spring file.
>
> This web service may throw modeled SOAP Faults, and when it does it
> shouldn't print the full stack trace.
> When I run the service in the tests (starting a Spring application in a
> Spring's ClassPathXmlApplicationContext() ) the body of the fault is empty
> like this:
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>Msg OperationFault</faultstring>
>          <detail>
>             <ns1:operationFault xmlns:ns1="
> http://net.cristcost/ns/service/fault">
>                <faultType xsi:type="srvfault:OperationFaultType"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                   xmlns:srvfault="http://net.cristcost/ns/service/fault
> ">CONSUMER_ERROR</faultType>
>             </ns1:operationFault>
>          </detail>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
>
>
> But when I run the same spring xml file inside servicemix, at every fault
> the full server stack trace is printed in many <classContext > tags like
> the following:
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>    <soap:Body>
>       <soap:Fault>
>          <faultcode>soap:Server</faultcode>
>          <faultstring>Msg OperationFault</faultstring>
>          <detail>
>             <ns1:operationFault xmlns:ns1="
> http://net.cristcost/ns/service/fault">
>                <faultType xsi:type="srvfault:OperationFaultType"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                   xmlns:srvfault="http://net.cristcost/ns/service/fault
> ">CONSUMER_ERROR</faultType>
>                <classContext xmlns:srvfault="
> http://net.cristcost/ns/service/fault
> ">net.cristcost.test.ExceptionTestService</classContext>
>                ....
>                <classContext xmlns:srvfault="
> http://net.cristcost/ns/service/fault
> ">org.eclipse.jetty.util.thread.QueuedThreadPool</classContext>
>                <classContext xmlns:srvfault="
> http://net.cristcost/ns/service/fault">java.lang.Thread</classContext>
>             </ns1:operationFault>
>          </detail>
>       </soap:Fault>
>    </soap:Body>
> </soap:Envelope>
>
>
>
> Anyone knows how to disable this behaviour or at least where in servicemix
> to investigate to find a solution?
>