Hi All,
We are getting below exception while invoking webservice from AEM.
org.apache.sling.api.scripting.ScriptEvaluationException: javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.apache.cxf.jaxb.attachment.JAXBAttachmentMarshaller.addMtomAttachment(Ljavax/activation/DataHandler;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, org/apache/cxf/jaxb/attachment/JAXBAttachmentMarshaller, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/activation/DataHandler used in the signature
and we were able to fix the issue by setting below given property in sling.properties file as suggested in one of the adobe forum queries. (https://forums.adobe.com/thread/2336233 )
org.osgi.framework.system.packages.extra=javax.activation;version\="1.1.1”
But this fix is throwing an error in existing email sending functionality in our project. Exception is as follows,
“Error occurred while sending email: com.day.cq.mailer.MailingException: org.apache.commons.mail.EmailException: Sending the email to the following server failed"
so we have to revert our fix for class loader constraint viloation exception.
We have raised a daycare ticket for this and what they have mentioned was "The fix (modifying sling.properties) you have referred to is also from the forum is also from an older version of CQ and shouldn't be applied on top of AEM."
Could you please suggest an alternate solution for class loader constraint issue?