[
https://issues.apache.org/jira/browse/CAMEL-15156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
kaleem ahmed updated CAMEL-15156:
---------------------------------
Attachment: TestCamelMail.zip
> org.apache.camel.component.mail.MailBinding.populateMailMessage
> java.lang.NullPointerException:
> -----------------------------------------------------------------------------------------------
>
> Key: CAMEL-15156
> URL: https://issues.apache.org/jira/browse/CAMEL-15156
> Project: Camel
> Issue Type: Bug
> Components: camel-mail
> Affects Versions: 3.2.0, 3.3.0
> Environment: Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> java.lang.NullPointerException: null
> at
> org.apache.camel.component.mail.MailBinding.populateMailMessage(MailBinding.java:133)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:
> ?]
> at
> org.apache.camel.component.mail.MailProducer.process(MailProducer.java:66)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:?]
> at
> org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:197)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-depende
> ncies.jar:?]
> at
> org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:309)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-depe
> ndencies.jar:?]
> at
> org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:182)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar
> :?]
> at
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)
> [TestCamelMail-1.0-SNAPSHOT-ja
> r-with-dependencies.jar:?]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-d
> ependencies.jar:?]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-depen
> dencies.jar:?]
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:?]
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.
> jar:?]
> at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:198)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.ja
> r:?]
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:78)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:?]
> at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_161]
> at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_161]
> [1) thread #2 - timer://mytimer] TimerConsumer WARN Error processing
> exchange. Exchange[ID-DEMHAS-KA-1591558798961-0-1]. Caused by: [j
> ava.lang.NullPointerException - null]
> java.lang.NullPointerException: null
> at
> org.apache.camel.component.mail.MailBinding.populateMailMessage(MailBinding.java:133)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:
> ?]
> at
> org.apache.camel.component.mail.MailProducer.process(MailProducer.java:66)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:?]
> at
> org.apache.camel.processor.SendDynamicProcessor.lambda$process$0(SendDynamicProcessor.java:197)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-depende
> ncies.jar:?]
> at
> org.apache.camel.impl.engine.DefaultProducerCache.doInAsyncProducer(DefaultProducerCache.java:309)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-depe
> ndencies.jar:?]
> at
> org.apache.camel.processor.SendDynamicProcessor.process(SendDynamicProcessor.java:182)
> ~[TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar
> :?]
> at
> org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)
> ~[TestCamelMail-1.0-SNAPSHOT-j
> ar-with-dependencies.jar:?]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-d
> ependencies.jar:?]
> at
> org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-depen
> dencies.jar:?]
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:?]
> at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.
> jar:?]
> at
> org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:198)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.ja
> r:?]
> at
> org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:78)
> [TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar:?]
> at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_161]
> at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_161]
> Reporter: kaleem ahmed
> Priority: Major
> Attachments: TestCamelMail.zip
>
>
> There is an issue with smtp endpoint, it fails with a null pointer exception
> when the project is run as a standalone jar file.
> NOTE: This is not an issue when I use the mvn compile exec:java.
> Steps to replicate:
> # create a simple maven project with apache-camel arch (Here is bare bone
> code sample [https://github.com/drkaleem/test_camel_mail])
> # run the code with "mvn compile exec:java". This runs successfully.
> # Generate a standalone jar with the command "mvn clean package". This will
> generate required jar files in target folder.
> # run the java jar file with "java -jar
> .\target\TestCamelMail-1.0-SNAPSHOT-jar-with-dependencies.jar". It fails with
> "java.lang.NullPointerException"
--
This message was sent by Atlassian Jira
(v8.3.4#803005)