rschreijer / lutung

Lutung - A Java Mandrill API Connector
179 stars 119 forks source link

getting null pointer on api.messages().sendTemplate() method #100

Open ihalilaltun opened 5 years ago

ihalilaltun commented 5 years ago

We are using the framework for more than 1 year without any problem, but recently we are getting following error without any stack trace. Since we cannot get any detailed log messages we cannot find the exact problem, is it mandrill itself or the data we send to mandrill. Any help appriciated.

java.lang.NullPointerException: null
    at com.microtripit.mandrillapp.lutung.model.MandrillRequestDispatcher.execute(MandrillRequestDispatcher.java:124) ~[lutung-0.0.8.jar!/:?]
    at com.microtripit.mandrillapp.lutung.controller.MandrillUtil.query(MandrillUtil.java:44) ~[lutung-0.0.8.jar!/:?]
    at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:212) ~[lutung-0.0.8.jar!/:?]
    at com.microtripit.mandrillapp.lutung.controller.MandrillMessagesApi.sendTemplate(MandrillMessagesApi.java:139) ~[lutung-0.0.8.jar!/:?]
    at com.segmentify.lotr.legolas.worker.MailSender.lambda$send$2(MailSender.java:143) ~[classes!/:0.0.1-SNAPSHOT]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
ihalilaltun commented 5 years ago

@rschreijer any comments?

thonier commented 4 years ago

Not sure if this is relevant to anyone, but we also began to observe the issue intermittently on some of our machines. In our case it turned out to be an issue occurring when a proxy was detected. The reason is that on this line: https://github.com/rschreijer/lutung/blob/98268f9ff862efd4e5dd3b8ea5da6e85591e5293/src/main/java/com/microtripit/mandrillapp/lutung/model/MandrillRequestDispatcher.java#L84

getParams() is now deprecated so this essentially fails.

We put in a workaround to ignore the proxy selection for "mandrillapp.com" and that was good enough for us.

Hope this helps, but it would be nice if someone could update the code at some point.

pv-pavan commented 4 years ago

https://github.com/rschreijer/lutung/pull/103 This should fix. Please build from https://github.com/pv-pavan/lutung