You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Filippo Ortolan (Updated) (JIRA)" <ji...@apache.org> on 2012/02/21 10:45:34 UTC

[jira] [Updated] (RAMPART-358) Possible NullPointerException in RampartEngine.isSecurityFault(RampartMessageData)

     [ https://issues.apache.org/jira/browse/RAMPART-358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filippo Ortolan updated RAMPART-358:
------------------------------------

    Description: 
in RampartEngine class I get a NullPointerException in line 369 (method: isSecurityFault). Seems that this line:
if (faultCode.getTextAsQName().getNamespaceURI().equals(WSConstants.WSSE_NS)) {
				return true;
			}
throws the exception because getTextAsQName() can return null and this should be handled.

Solution:

QName faultCodeQName = faultCode.getTextAsQName();
if (faultCodeQName == null) {
// handle exception
   return false; // ?
} else {
   if (faultCodeQName.getNamespaceURI().equals(WSConstants.WSSE_NS)) {
      return true;
   }
}


  was:
in RampartEngine class I get a NullPointerException in line 369 (method: isSecurityFault). Seems that this line:
if (faultCode.getTextAsQName().getNamespaceURI().equals(WSConstants.WSSE_NS)) {
				return true;
			}
throws the exception because getTextAsQName() can return null and this should be handled.

Solution:

QName faultCodeQName = faultCode.getTextAsQName();
if (faultCodeQName == null) {
// handle exception
   return false; // ?
} else {
   if (faultCodeQName.getNamespaceURI.equals(WSConstants.WSSE_NS)) {
      return true;
   }
}


    
> Possible NullPointerException in RampartEngine.isSecurityFault(RampartMessageData)
> ----------------------------------------------------------------------------------
>
>                 Key: RAMPART-358
>                 URL: https://issues.apache.org/jira/browse/RAMPART-358
>             Project: Rampart
>          Issue Type: Bug
>          Components: rampart-core
>            Reporter: Filippo Ortolan
>             Fix For: 1.6.2
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> in RampartEngine class I get a NullPointerException in line 369 (method: isSecurityFault). Seems that this line:
> if (faultCode.getTextAsQName().getNamespaceURI().equals(WSConstants.WSSE_NS)) {
> 				return true;
> 			}
> throws the exception because getTextAsQName() can return null and this should be handled.
> Solution:
> QName faultCodeQName = faultCode.getTextAsQName();
> if (faultCodeQName == null) {
> // handle exception
>    return false; // ?
> } else {
>    if (faultCodeQName.getNamespaceURI().equals(WSConstants.WSSE_NS)) {
>       return true;
>    }
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org