One Star

[resolved] problem with tsendmail in karaf, java.lang.ClassCastException

Hi all!
a new resolution problem of api: i use a camel route with a cTalendJob-> in this cTalendJob i have a tSendMail.
So, when i execute this route in the Studio, it's works! no problem.
When i deployed in karaf, i have:

Exception in component tSendMail_2
java.lang.ClassCastException: com.sun.mail.handlers.text_plain cannot be cast to
 javax.activation.DataContentHandler
        at javax.activation.MailcapCommandMap.getDataContentHandler(MailcapComma
ndMap.java:609)
        at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCo
mmandMap.java:563)
        at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:6
25)
        at javax.activation.DataHandler.writeTo(DataHandler.java:329)
        at javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:248)
        at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1268
)
        at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1001
)
        at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:33
3)
        at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1255
)
        at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2012)
        at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:1980)
        at javax.mail.Transport.send(Transport.java:97)
        at extractionsgenereriques.test_xsa_ge_sendfile_0_2.TEST_XSA_GE_SendFile
.tRouteInput_2Process(TEST_XSA_GE_SendFile.java:1173)
        at extractionsgenereriques.test_xsa_ge_sendfile_0_2.TEST_XSA_GE_SendFile
.runJobInTOS(TEST_XSA_GE_SendFile.java:1517)
        at org.talend.camel.TalendProducer.invokeTalendJob(TalendProducer.java:1
06)
        at org.talend.camel.TalendProducer.process(TalendProducer.java:70)
        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncP
rocessorBridge.process(AsyncProcessorConverterHelper.java:61)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProc
essor.java:122)
        at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.j
ava:298)
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:1
17)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:72)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(Trace
Interceptor.java:91)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler
(RedeliveryErrorHandler.java:335)
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryE
rrorHandler.java:220)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:46)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.interceptor.DefaultChannel.process(Default
Channel.java:308)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteCon
textProcessor.java:46)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWor
kProcessor.java:150)
Connecting to URL: tcp://talend-jsr-dev.almerys.local:61616
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProc
essor.java:117)
Producing queue: Q.ebeeexchange.common.logs
        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNe
xt(RouteInflightRepositoryProcessor.java:48)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:73)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(Delegat
eAsyncProcessor.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:90)
        at org.apache.camel.management.InstrumentationProcessor.process(Instrume
ntationProcessor.java:72)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelp
er.java:99)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsy
ncProcessor.java:86)
        at org.apache.camel.component.jms.EndpointMessageListener.onMessage(Endp
ointMessageListener.java:104)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doI
nvokeListener(AbstractMessageListenerContainer.java:562)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.inv
okeListener(AbstractMessageListenerContainer.java:500)
        at org.springframework.jms.listener.AbstractMessageListenerContainer.doE
xecuteListener(AbstractMessageListenerContainer.java:468)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContai
ner.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContai
ner.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
cMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103
)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
cMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:
1095)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$Asyn
cMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

The problem is the same if i choose 'HTML' option instead of Text Plain. (the message is about com.sun.mail.handlers.html or something like this)
i tryed to force mail.api in cTalendJob via cConfig or in the job itself via a tLibraryLoad, it's the same problem.
The manisfest looks good, the mail.jar is embeded in .kar file, so...
Someone have an idea perhaps?
Xavier
1 ACCEPTED SOLUTION

Accepted Solutions
One Star

Re: [resolved] problem with tsendmail in karaf, java.lang.ClassCastException

Resolved!
it was a conflict with another application: Adelia Studio, which wrote entries in PATH windows variable.
Desinstallation of this horrible application resolved the probleme!
Thanks to Yuri, who spent time with me to look at this problem.
Xavier
2 REPLIES
One Star

Re: [resolved] problem with tsendmail in karaf, java.lang.ClassCastException

opened a jira for this problem:
https://jira.talendforge.org/browse/TESB-14183
One Star

Re: [resolved] problem with tsendmail in karaf, java.lang.ClassCastException

Resolved!
it was a conflict with another application: Adelia Studio, which wrote entries in PATH windows variable.
Desinstallation of this horrible application resolved the probleme!
Thanks to Yuri, who spent time with me to look at this problem.
Xavier