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.
As explained in the comments, please check that you add
1500:com.typesafe.plugin.CommonsMailerPlugin
to yourconf/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
.