Examples of MarshallingException


Examples of org.jongo.marshall.MarshallingException

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        try {
            mapping.getWriter(pojo).writeValue(output, pojo);
        } catch (IOException e) {
            throw new MarshallingException("Unable to marshall " + pojo + " into bson", e);
        }
        return Bson.createDocument(output.toByteArray());
    }
View Full Code Here

Examples of org.jongo.marshall.MarshallingException

                return marshallArray((Object[]) parameter);
            }
            return marshallDocument(parameter);
        } catch (Exception e) {
            String message = String.format("Unable to marshall parameter: %s", parameter);
            throw new MarshallingException(message, e);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

    public Element marshall(XMLObject xmlObject) throws MarshallingException {
        try {
            Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
            return marshall(xmlObject, document);
        } catch (ParserConfigurationException e) {
            throw new MarshallingException("Unable to create Document to place marshalled elements in", e);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

            signature.releaseParentDOM(true);
            return signatureElement;

        } catch (XMLSecurityException e) {
            log.error("Unable to construct signature Element " + signature.getElementQName(), e);
            throw new MarshallingException("Unable to construct signature Element " + signature.getElementQName(), e);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

                domElement.setAttribute(KeyDescriptor.USE_ATTRIB_NAME, use.toString().toLowerCase());
            } else if (use.equals(UsageType.UNSPECIFIED)) {
                // emit nothing for unspecified - this is semantically equivalent to non-existent attribute
            } else {
                // Just in case values are unknowingly added to UsageType in the future...
                throw new MarshallingException("KeyDescriptor had illegal value for use attribute: " + use.toString());
            }
        }
    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

    public Element marshall(XMLObject xmlObject) throws MarshallingException {
        try {
            Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
            return marshall(xmlObject, document);
        } catch (ParserConfigurationException e) {
            throw new MarshallingException("Unable to create Document to place marshalled elements in", e);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

            signature.releaseParentDOM(true);
            return signatureElement;

        } catch (XMLSecurityException e) {
            log.error("Unable to construct signature Element " + signature.getElementQName(), e);
            throw new MarshallingException("Unable to construct signature Element " + signature.getElementQName(), e);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

        if (extendedMetadata == null) {
            try {
                extendedMetadata = metadataManager.getExtendedMetadata(descriptor.getEntityID());
            } catch (MetadataProviderException e) {
                logger.error("Unable to locate extended metadata", e);
                throw new MarshallingException("Unable to locate extended metadata", e);
            }
        }

        try {
            if (extendedMetadata.isLocal() && extendedMetadata.isSignMetadata()) {
                Credential credential = keyManager.getCredential(extendedMetadata.getSigningKey());
                String signingAlgorithm = extendedMetadata.getSigningAlgorithm();
                String keyGenerator = extendedMetadata.getKeyInfoGeneratorName();
                element = SAMLUtil.marshallAndSignMessage(descriptor, credential, signingAlgorithm, keyGenerator);
            } else {
                element = SAMLUtil.marshallMessage(descriptor);
            }
        } catch (MessageEncodingException e) {
            logger.error("Unable to marshall message", e);
            throw new MarshallingException("Unable to marshall message", e);
        }

        return XMLHelper.nodeToString(element);

    }
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

        SAMLObject<TestObject> tso = new SAMLObject<TestObject>(to);

        Marshaller mock = createMock(Marshaller.class);
        Configuration.getMarshallerFactory().registerMarshaller(to.getElementQName(), mock);

        expect(mock.marshall(to)).andThrow(new MarshallingException("Error"));

        replay(mock);
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        ObjectOutputStream stream = new ObjectOutputStream(outStream);
        stream.writeObject(tso);
View Full Code Here

Examples of org.opensaml.xml.io.MarshallingException

                domElement.setAttribute(KeyDescriptor.USE_ATTRIB_NAME, use.toString().toLowerCase());
            } else if (use.equals(UsageType.UNSPECIFIED)) {
                //emit nothing for unspecified - this is semantically equivalent to non-existent attribute
            } else {
                // Just in case values are unknowingly added to UsageType in the future...
               throw new MarshallingException("KeyDescriptor had illegal value for use attribute: " + use.toString());
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.