Skip to Content.
Sympa Menu

mace-opensaml-users - Re: Extending the opensaml

Subject: OpenSAML user discussion

List archive

Re: Extending the opensaml


Chronological Thread 
  • From: HÃ¥kon Tuvin Sagehaug <>
  • To:
  • Subject: Re: Extending the opensaml
  • Date: Tue, 16 Oct 2007 09:29:42 +0200

Manuela Stanica skrev:
Hi,

have you registered the object providers for your new saml2 objects and their corresponding builder, marhaller and unmarshaller in the org.opensaml.Configuration class?
In your case it could look similar to:

Configuration.registerObjectProvider(XACMLAuthzDecisionQuery.DEFAULT_ELEMENT_NAME, new XACMLAuthzDecisionQueryBuilder(), new XACMLAuthzDecisionQueryMarshaller(), new XACMLAuthzDecisionQueryUnmarshaller(), null);

(and same for XACMLAuthzDecisionQueryType).

I've also needed to build extensions to the saml2 library, and it all worked when just adding these lines before code that uses the new objects.

Hope this helps (?)

Cheers,
Manuela



Håkon Tuvin Sagehaug schrieb:
Hi

I want to extend the saml 2 protocol, but have some problems getting it to work. I have an interface, a class that implements the interface, builder,marshaller and unmarshaller. In
my saml2-protocol-config.xml I have this information(both in the opensaml-src and opensaml-xmltooling):

<ObjectProvider qualifiedName="saml2p:XACMLAuthzDecisionQuery">
<BuilderClass className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryBuilder" />
<MarshallingClass className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryMarshaller" />
<UnmarshallingClass className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryUnmarshaller" />
</ObjectProvider>

<ObjectProvider qualifiedName="saml2p:XACMLAuthzDecisionQueryType">
<BuilderClass className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryBuilder" />
<MarshallingClass className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryMarshaller" />
<UnmarshallingClass className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryUnmarshaller" />
</ObjectProvider>
and here is the error stack I'm getting

Exception in thread "main"
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:919)
at org.opensaml.xml.XMLObjectBuilderFactory.deregisterBuilder(XMLObjectBuilderFactory.java:115)
at org.opensaml.xml.Configuration.deregisterObjectProvider(Configuration.java:123)
at org.opensaml.xml.XMLConfigurator.initializeObjectProviders(XMLConfigurator.java:264)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:179)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:161)
at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:129)
at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:127)
at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:71)
at opensaml20.test.TestCreateSAML20Assertion.main(TestCreateSAML20Assertion.java:1036)

It looks to me that the builder can not be resolved or something.
Can anyone help me????



Hi

I got a NullPointerException when I did this(what mauela suggested), I think the problem is that the builders can't be created, but I can't figure it out. Here is how it look like
public class XACMLAuthzDecisionQueryBuilder extends AbstractSAMLObjectBuilder<XACMLAuthzDecisionQuery>{...} the marshaller
public class XACMLAuthzDecisionQueryMarshaller extends AbstractSAMLObjectMarshaller{...} and the unmarshaller
public class XACMLAuthzDecisionQueryUnMarshaller extends AbstractSAMLObjectUnmarshaller{...}

Does anyone have a tip for me??

--
Håkon Sagehaug
Research Assistant
Parallab
Bergen Center for Computational Science (BCCS)



Archive powered by MHonArc 2.6.16.

Top of Page