Mailer plugin throws NullPointerException

▼魔方 西西 提交于 2019-12-23 14:02:34

问题


When I try to use the Mailer Plugin (version 2.1-SNAPSHOT) as explained here everything seems fine, meaning all dependencies are resolved and there are no compilation errors.

However when this code is executed

MailerAPI mail = play.Play.application().plugin(MailerPlugin.class).email();

I get a NullPointerException on this line. The exception is generated because the call to plugin returns null.

Any hints on what is going on here?

I'm using Play 2.1-RC2 and the app is written in Java.


回答1:


As explained in the comments, please check that you add 1500:com.typesafe.plugin.CommonsMailerPlugin to your conf/play.plugins in order to register the plugin as explained in the documentation.

I think that Play should throw an explicit message instead of a NullPointerException.



来源:https://stackoverflow.com/questions/14307978/mailer-plugin-throws-nullpointerexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!