SAML Linkage error.

Avatar

Avatar

kalyanc42390873

Avatar

kalyanc42390873

kalyanc42390873

18-07-2016

Hi,

We are trying to post a SAML request from AEM. For that we have created a AEM servlet which frame SAML request and do a post call.While building the bundle in eclipse we didnt get any error but when we install the bundle in Felix console we are having some reference errors. To resolve these reference errors we kept all required dependency jars(SAML related Jars) in one bundle and then uploaded this bundle before we upload our project bundle. This resolved all the dependency issues (our project bundle is in active state.now and servlet got registered()

 

But when we call our servlet we are getting below Linkage error in error.log file.

Error in error.log file : java.lang.LinkageError: loader constraint violation: when resolving field "DEFAULT_ELEMENT_NAME" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the referring class, org/opensaml/saml2/core/AuthnRequest, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type

Java code which is causing the issue in servlet: 

AuthnRequest authnRequest =  buildSamlObject(AuthnRequest.DEFAULT_ELEMENT_NAME,AuthnRequestBuilder.class);

Can any one please let me know what could be the issue here.

Thanks in advance.

Regards,

Kalyan

View Entire Topic

Avatar

Avatar

kalyanc42390873

Avatar

kalyanc42390873

kalyanc42390873

19-07-2016

I have updated "Imported-Packge" & "Exported-Packge" sections in the manifest file of dependency bundle (by keeping only required references).Then the above Linkage error problem was solved.