mace-opensaml-users - Re: [OpenSAML] XACML Unmarshalling ClassCast XSAnyImpl Exceptions
Subject: OpenSAML user discussion
List archive
- From: "" <>
- To:
- Subject: Re: [OpenSAML] XACML Unmarshalling ClassCast XSAnyImpl Exceptions
- Date: Sat, 24 Apr 2010 08:35:14 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=fVi48HfHn4RNaA1eYzSouE2bwXPtdKgJoKOF2ty3+Q4TH0aJA7syRRw0WtdR3dLTcA hrvEg8nxwh/Iq+nSMzZghWVw1K3IBbXpwa7hc++x0lzgvnBciVlLD+YWjs3Q2At99AJ9 nFLU2bCJu9CNhuXw+ClbxoXbQiIHWWAheFxBw=
Hi Brent,
I'm experiencing a similar problem. I was unable to marshall a
Assertion that was
containing an umarshalled XACMLPolicyStatement, because of the XSAnyImpl
class cast. Now, after changing a bit the namespaces, I have another
error (see below).
I've a method that obtains a PolicySet as org.w3c.dom.Element,
unmarshalls it in a
PolicySetType correctly.
I want to create a new SAML assertion (a Delegated one) containing one
Authentication
Statement, one AttributeStatement and a XACMLPolicyStatement.
// here the code for unmarshalling the policy:
XACMLPolicyStatementTypeImplBuilder stmtBuilder =
(XACMLPolicyStatementTypeImplBuilder)bf.getBuilder(XACMLPolicyStatementType.DEFAULT_ELEMENT_NAME_XACML20);
XACMLPolicyStatementType stmt =
stmtBuilder.buildObject(SAMLProfileConstants.SAML20XACML20_NS,
XACMLPolicyStatementType.DEFAULT_ELEMENT_LOCAL_NAME,
SAMLProfileConstants.SAML20XACMLASSERTION_PREFIX);
UnmarshallerFactory unmarshallerFactory =
org.opensaml.xml.Configuration.getUnmarshallerFactory();
Unmarshaller policyQueryUnmarshaller =
unmarshallerFactory.getUnmarshaller(PolicySetType.DEFAULT_ELEMENT_NAME);
PolicySetType p;
try {
p =
(PolicySetType)policyQueryUnmarshaller.unmarshall(this.policy);
stmt.getPolicySets().add(p);
} catch (UnmarshallingException e1) {
throw new IdentityProviderException(e1);
}
assertion.getStatements().add(stmt);
// end here
// here the code for Marshalling everything:
MarshallerFactory marshallerFactory = Configuration
.getMarshallerFactory();
Marshaller marshaller = marshallerFactory
.getMarshaller(Assertion.DEFAULT_ELEMENT_NAME);
try {
assertionElement = marshaller.marshall(assertion);
} catch (MarshallingException e) {
throw new IdentityProviderException(e);
}
the error is:
08:33:36,266 ERROR [STDERR] org.opensaml.xml.XMLRuntimeException: DOM
Element node adoption failed
08:33:36,278 ERROR [STDERR] at
org.opensaml.xml.util.XMLHelper.adoptElement(XMLHelper.java:482)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.util.XMLHelper.appendChildElement(XMLHelper.java:467)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:161)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallChildElements(AbstractXMLObjectMarshaller.java:316)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallInto(AbstractXMLObjectMarshaller.java:224)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:175)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallChildElements(AbstractXMLObjectMarshaller.java:316)
08:33:36,283 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshallInto(AbstractXMLObjectMarshaller.java:224)
08:33:36,284 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:130)
08:33:36,284 ERROR [STDERR] at
org.opensaml.xml.io.AbstractXMLObjectMarshaller.marshall(AbstractXMLObjectMarshaller.java:86)
08:33:36,284 ERROR [STDERR] at
com.spirit.saml.issuers.oo.OOHoKXSPA.buildAssertion(OOHoKXSPA.java:517)
08:33:36,284 ERROR [STDERR] at
com.spirit.saml.issuers.oo.OOHoKXSPAMessageReceiver.process(OOHoKXSPAMessageReceiver.java:281)
08:33:36,284 ERROR [STDERR] at
com.spirit.saml.MessageReceiver.soap12Request(MessageReceiver.java:64)
08:33:36,284 ERROR [STDERR] at
com.spirit.soap.SoapServer.executeSoap12(SoapServer.java:345)
08:33:36,284 ERROR [STDERR] at
com.spirit.soap.SoapServer.doPost(SoapServer.java:153)
08:33:36,284 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
08:33:36,284 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
08:33:36,284 ERROR [STDERR] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
08:33:36,284 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
08:33:36,284 ERROR [STDERR] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
08:33:36,284 ERROR [STDERR] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
08:33:36,285 ERROR [STDERR] at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
08:33:36,285 ERROR [STDERR] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
08:33:36,285 ERROR [STDERR] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
08:33:36,285 ERROR [STDERR] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
08:33:36,285 ERROR [STDERR] at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
08:33:36,285 ERROR [STDERR] at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
08:33:36,285 ERROR [STDERR] at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
08:33:36,285 ERROR [STDERR] at java.lang.Thread.run(Thread.java:637)
using opensaml 2.3.1.
--
Massimiliano Masi
http://www.mascanc.net/~max
- Re: [OpenSAML] XACML Unmarshalling ClassCast XSAnyImpl Exceptions, , 04/24/2010
Archive powered by MHonArc 2.6.16.