Example usage for javax.xml.crypto URIReferenceException getCause

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

Introduction

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

Prototype

public Throwable getCause() 

Source Link

Document

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

Usage

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

/**
 * Signs the signature./*ww  w.  j a v  a2 s  . c  o m*/
 * @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);
    }

}