Buggy code:
public class KerberosSecurity extends BinarySecurity { private static final Logger LOG = org . slf4j . LoggerFactory . getLogger ( KerberosSecurity . class ) ; private SecretKey secretKey ; public KerberosSecurity ( Element elem , BSPEnforcer bspEnforcer ) throws WSSecurityException { } public KerberosSecurity ( Document doc ) { } public boolean isV5ApReq ( ) { } public boolean isGssV5ApReq ( ) { } public void retrieveServiceTicket ( CallbackHandler callbackHandler ) throws WSSecurityException { } public void retrieveServiceTicket ( String jaasLoginModuleName , CallbackHandler callbackHandler , String serviceName ) throws WSSecurityException { } public void retrieveServiceTicket ( String jaasLoginModuleName , CallbackHandler callbackHandler , String serviceName , boolean isUsernameServiceNameForm ) throws WSSecurityException { } public void retrieveServiceTicket ( String jaasLoginModuleName , CallbackHandler callbackHandler , String serviceName , boolean isUsernameServiceNameForm , boolean requestCredDeleg ) throws WSSecurityException { } public void retrieveServiceTicket ( String jaasLoginModuleName , CallbackHandler callbackHandler , String serviceName , boolean isUsernameServiceNameForm , boolean requestCredDeleg , GSSCredential delegatedCredential ) throws WSSecurityException { LoginContext loginContext = null ; try { if ( callbackHandler == null ) { loginContext = new LoginContext ( jaasLoginModuleName ) ; } else { loginContext = new LoginContext ( jaasLoginModuleName , callbackHandler ) ; } loginContext . login ( ) ; } catch ( LoginException ex ) { if ( KerberosSecurity . LOG . isDebugEnabled ( ) ) { KerberosSecurity . LOG . debug ( ex . getMessage ( ) , ex ) ; } throw new WSSecurityException ( ErrorCode . FAILURE , "kerberosLoginError" , ex , ex . getMessage ( ) ) ; } if ( KerberosSecurity . LOG . isDebugEnabled ( ) ) { KerberosSecurity . LOG . debug ( "Successfully<seq2seq4repair_space>authenticated<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>TGT" ) ; } Subject clientSubject = loginContext . getSubject ( ) ; Set < Principal > clientPrincipals = clientSubject . getPrincipals ( ) ; if ( clientPrincipals . isEmpty ( ) ) { throw new WSSecurityException ( ErrorCode . FAILURE , "kerberosLoginError" , "No<seq2seq4repair_space>Client<seq2seq4repair_space>principals<seq2seq4repair_space>found<seq2seq4repair_space>after<seq2seq4repair_space>login" ) ; } KerberosTicket tgt = getKerberosTicket ( clientSubject , null ) ; KerberosClientExceptionAction action = new KerberosClientExceptionAction ( clientPrincipals . iterator ( ) . next ( ) , serviceName , isUsernameServiceNameForm , requestCredDeleg , delegatedCredential , false , false ) ; KerberosContext krbCtx = null ; try { krbCtx = ( ( KerberosContext ) ( Subject . doAs ( clientSubject , action ) ) ) ; Key sessionKey = krbCtx . getSecretKey ( ) ; if ( sessionKey != null ) { secretKey = new SecretKeySpec ( sessionKey . getEncoded ( ) , sessionKey . getAlgorithm ( ) ) ; } else { KerberosTicket serviceTicket = getKerberosTicket ( clientSubject , tgt ) ; if ( serviceTicket != null ) { secretKey = serviceTicket . getSessionKey ( ) ; } } if ( KerberosSecurity . LOG . isDebugEnabled ( ) ) { if ( ( secretKey ) == null ) { KerberosSecurity . LOG . debug ( "No<seq2seq4repair_space>secret<seq2seq4repair_space>key<seq2seq4repair_space>for<seq2seq4repair_space>kerberos<seq2seq4repair_space>was<seq2seq4repair_space>found" ) ; } else { KerberosSecurity . LOG . debug ( "Successfully<seq2seq4repair_space>retrieved<seq2seq4repair_space>a<seq2seq4repair_space>secret<seq2seq4repair_space>key<seq2seq4repair_space>for<seq2seq4repair_space>kerberos" ) ; } } setToken ( krbCtx . getKerberosToken ( ) ) ; } catch ( PrivilegedActionException e ) { Throwable cause = e . getCause ( ) ; if ( cause instanceof WSSecurityException ) { throw ( ( WSSecurityException ) ( cause ) ) ; } else { <START_BUG> throw new WSSecurityException ( ErrorCode . FAILURE , "kerberosServiceTicketError" , new Object [ ] { } , cause ) ; <END_BUG> } } finally { if ( krbCtx != null ) { krbCtx . dispose ( ) ; } } if ( KerberosSecurity . LOG . isDebugEnabled ( ) ) { KerberosSecurity . LOG . debug ( "Successfully<seq2seq4repair_space>retrieved<seq2seq4repair_space>a<seq2seq4repair_space>service<seq2seq4repair_space>ticket" ) ; } if ( "" . equals ( getValueType ( ) ) ) { setValueType ( WSS_GSS_KRB_V5_AP_REQ ) ; } } private KerberosTicket getKerberosTicket ( Subject clientSubject , KerberosTicket previousTicket ) { } public SecretKey getSecretKey ( ) { } public static boolean isKerberosToken ( String valueType ) { } }

Fix:
throw new WSSecurityException ( ErrorCode . FAILURE , "kerberosServiceTicketError" , cause ) ;