Hi,
have you tried setting the exceptionMessageCauseEnabled property? By
default, the exception cause is not written out in the fault for
security concerns. But you can set this property to true to change
this behavior. I think this is what you are looking for, no?

http://cxf.apache.org/docs/debugging-and-logging.html#DebuggingandLogging-Stacktraceinfaultdetails

regards, aki

2012/11/29 Bin Zhu <[email protected]>:
> Hi,
>
> When there is unchecked NPE thrown, the SOAPFault in CXF will only throw
> the "Fault occurred while processing." message rather than the original NPE
> message.
> This message("Fault occurred while processing.") hides the details of the
> exception and will make user hard to find the root cause of the exception.
>
> I did some investigation and found that
> in org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor and
> org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor,
> It will check fault.getMessage() :
>                 if (fault.getMessage() != null) {
>                     if (message.get("forced.faultstring") != null) {
>                         writer.writeCharacters((String)
> message.get("forced.faultstring"));
>                     } else {
>                         writer.writeCharacters(fault.getMessage());
>                     }
>
>                 } else {
>                     writer.writeCharacters("Fault occurred while
> processing.");
>                 }
> But for NPE, the fault.getMessage() will return null instead of the
> "java.lang.NullPointerException" in the getMessage() in NPE.
>
> It is suggested to improve the getMessage in the SOAPFault to let it
> include the"java.lang.NullPointerException" so that the user can get the
> details of the SOAPFault. Any suggestions? Thanks.

Reply via email to