Skip navigation

CQ5

Currently Being Moderated

Problem with javax.activation when sending html mails and/or using CXF

Jul 27, 2012 7:39 AM

Tags: #cq5.5 #osgi #javax.activation

In my CQ5.5 installation I have a component which sends html-mails and another component which uses CXF to import data from an external data provider (SOAP interface) and to render that data on a web page. Therefore, both components (which are packaged in different bundles) use javax.activation. The javax.activation package is provided by two different bundles, either by org.apache.felix.framework or by com.day.commons.osgi.wrapper.mail.

 

I’ve noticed that there’s some mutual exclusiveness. If I manage to obtain javax.activation from com.day.commons.osgi.wrapper.mail, I’m able to send html mails, but get an error (loader constraint violation, see [1]) when trying to get the data using CXF.

 

On the other side, if I manage to obtain javax.activation from org.apache.felix.framework, I’m able to get and render the data using CXF but fail when trying to send html formatted mails.

 

How can I solve this problem?

 

Note: I’m wrapping the calls to the JaxWs classes generated by CXF in an OSGI-aware classloader (by setting the classloader to the CXF bundle).

 

 

[1] Caused by: java.lang.LinkageError: loader constraint violation:

when resolving overridden method

"org.apache.cxf.jaxb.attachment.JAXBAttachmentMarshaller.addMtomAttach ment(Ljavax/activation/DataHandler;Ljava/lang/String;Ljava/lang/String ;)Ljava/lang/String;"

the class loader (instance of org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5) 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

 
Replies
  • Currently Being Moderated
    Jul 29, 2012 4:48 PM   in reply to Luthiger

    Seems like third part jar also have javax.activation included causing  classloaders for java.mail and javax.activation not be same raising LinkageError. See making javax.activation as part of the system packages helps.  In order to do that add [1] at <cq_home>/crx-quickstart/conf/sling.properties,  restart the server & verify.

     

     

    [1]   org.osgi.framework.system.packages.extra=javax.activation

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 5:06 AM   in reply to Luthiger

    Please post results of dependency filter.  Please give one more try to revert old changes and add [1] and also make sure javax.activation obtained from com.day.commons.osgi.wrapper.mail,

     

    [1]  com.day.commons.osgi.wrapper.mail.system.packages.extra=javax.activat ion

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 14, 2012 9:21 AM   in reply to Luthiger

    Could you please file daycare and attach the component in the ticket.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points