cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bin Zhu (JIRA)" <>
Subject [jira] [Created] (CXF-4684) SOAPFault message improvement in CXF when there is unchecked NPE
Date Fri, 07 Dec 2012 09:29:20 GMT
Bin Zhu created CXF-4684:

             Summary: SOAPFault message improvement in CXF when there is unchecked NPE
                 Key: CXF-4684
             Project: CXF
          Issue Type: Bug
          Components: WS-* Components
    Affects Versions: 2.6.2
            Reporter: Bin Zhu

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.

1. 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 {

                } 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.

Fault.getMessage will return null in the NPE scenario while it's super class Throwable will
When there is NPE, the message attribute in Fault is null while the detailMessageAtrribute
is "java.lang.NullPointerException".
//  SoapFault->Fault means SoapFault class extends Fault class
    public String getMessage() {
        if (null != message) {
            return message.toString();
        return null;
public String getMessage() {
	return detailMessage;

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message