Example usage for javax.xml.crypto MarshalException getCause

List of usage examples for javax.xml.crypto MarshalException getCause

Introduction

In this page you can find the example usage for javax.xml.crypto MarshalException getCause.

Prototype

public Throwable getCause() 

Source Link

Document

Returns the cause of this MarshalException or null if the cause is nonexistent or unknown.

Usage

From source file:at.gv.egiz.bku.slcommands.impl.CreateXMLSignatureCommandImpl.java

/**
 * Signs the signature./*from w ww  . j a v a2s .c om*/
 * @param commandContext TODO
 * 
 * @throws SLCommandException
 *           if signing the signature fails
 * @throws SLViewerException
 */
private void signXMLSignature(SLCommandContext commandContext) throws SLCommandException, SLViewerException {

    try {
        signature.sign(commandContext.getSTAL(), keyboxIdentifier);
    } catch (MarshalException e) {
        log.error("Failed to marshall XMLSignature.", e);
        throw new SLCommandException(4000);
    } catch (XMLSignatureException e) {
        if (e.getCause() instanceof URIReferenceException) {
            URIReferenceException uriReferenceException = (URIReferenceException) e.getCause();
            if (uriReferenceException.getCause() instanceof SLCommandException) {
                throw (SLCommandException) uriReferenceException.getCause();
            }
        }
        log.error("Failed to sign XMLSignature.", e);
        throw new SLCommandException(4000);
    }

}