i have an issue which slowly starts driving me nuts, so any help would be really appreciated. I am using Talend ESB (based on ServiceMix and Camel). In one of my routes, i need to send files through a webservice using MTOM. I use the camel-cxf component with jaxb-binding for that. Somehow i absolutely can't get that to work. The Exception i get is:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
javax.activation.DataHandler does not have a no-arg default constructor.
I understand that this is because the JAXB-Marshaller needs a no-arg constructor (even thought i only marshal, never unmarshal), but i just don't know what to do about it. Tried to write my own CustomDataHandler by extending on javax.activation.DataHandler, so the exception was gone, but the file was not transferred at all. Also tried using an XML-Adapter like descriped here, didn't work either. I even ended up building a jar-project in eclipse for that and used maven-assembly-plugin to bundle all dependencies. That JAR is used in my route. It's working fine in Eclipse or in a webproject that i created out of pure desperation to prove that the JAR-content is finde. But i can't get it to work in the Talend/Karaf-container, whatever i do.
Here is the relevant mapping:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "document")
public class Document {
@XmlElement(required = true)
@XmlMimeType("application/octet-stream")
private DataHandler dataHandler;
...
Nearly forgot one more thing: it's working fine in the Talend Studio as well. "Just" not in the runtime container. Any idea what i can do about this or how i can work around it? Thanks in advance!