tebemis
tebemis

Reputation: 61

Mailer plugin throws NullPointerException

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.

Upvotes: 4

Views: 725

Answers (1)

ndeverge
ndeverge

Reputation: 21564

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.

Upvotes: 7

Related Questions