Camel mail component- javax.mail.internet.ParseException: In Content-Type string x-www-form-urlencoded, expected '/', got null

Solution Verified - Updated -

Issue

  • Application with camel mail component stop working and there is blew exception
---------------------------------------------------------------------------------------------------------------------------------------
RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
[mail              ] [mail              ] [activemq://queue:SENDMAIL                                                     ] [      1253]
[mail              ] [_log5             ] [log                                                                           ] [         0]
[mail              ] [_bean1            ] [bean[ref:GenerateMailBody method:generateMail]                                ] [         0]
[mail              ] [_log3             ] [log                                                                           ] [         0]
[mail              ] [_to1              ] [smtp:smtp.sample.com:587?mapMailMessage=false&cc=sample_email@sample.com] [      1253]
[mail              ] [log7              ] [log                                                                           ] [         1]

Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
javax.mail.internet.ParseException: In Content-Type string <x-www-form-urlencoded>, expected '/', got null
    at javax.mail.internet.ContentType.<init>(ContentType.java:104) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1508) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2271) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2231) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at org.apache.camel.component.mail.DefaultJavaMailSender.send(DefaultJavaMailSender.java:118) ~[66:org.apache.camel.camel-mail:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:63) ~[66:org.apache.camel.camel-mail:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:178) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:445) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:173) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) [405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) [405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) [405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) [405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97) [405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:113) [241:org.apache.camel.camel-jms:2.21.0.fuse-000077-redhat-1]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:719) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
    at java.lang.Thread.run(Thread.java:745) [?:?]
2019-06-13 15:13:12,827 | WARN  | msConsumer[SENDMAIL] | .a.c.c.j.EndpointMessageListener | 405 - org.apache.camel.camel-core - 2.21.0.fuse-000077-redhat-1 | Execution of JMS message listener failed. Caused by: [org.apache.camel.RuntimeCamelException - javax.mail.internet.ParseException: In Content-Type string <x-www-form-urlencoded>, expected '/', got null]
org.apache.camel.RuntimeCamelException: javax.mail.internet.ParseException: In Content-Type string <x-www-form-urlencoded>, expected '/', got null
    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:196) ~[241:org.apache.camel.camel-jms:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:117) ~[241:org.apache.camel.camel-jms:2.21.0.fuse-000077-redhat-1]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:719) ~[242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:679) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:649) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1166) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1158) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1055) [242:org.apache.servicemix.bundles.spring-jms:4.3.14.RELEASE_1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
    at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: javax.mail.internet.ParseException: In Content-Type string <x-www-form-urlencoded>, expected '/', got null
    at javax.mail.internet.ContentType.<init>(ContentType.java:104) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1508) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2271) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2231) ~[20:com.sun.mail.javax.mail:1.6.1.redhat-1]
    at org.apache.camel.component.mail.DefaultJavaMailSender.send(DefaultJavaMailSender.java:118) ~[66:org.apache.camel.camel-mail:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:63) ~[66:org.apache.camel.camel-mail:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:178) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:445) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:173) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:138) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:101) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97) ~[405:org.apache.camel.camel-core:2.21.0.fuse-000077-redhat-1]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:113) ~[241:org.apache.camel.camel-jms:2.21.0.fuse-000077-redhat-1]
    ... 11 more

Environment

  • Red Hat Fuse
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content