I believe it should use the interface type and not the class in the @Reference -
private MessageGatewayService messageGatewayService;
private MessageGateway messageGatewayService;
Scratch that; they are both interfaces.
You wouldn't explicitly set the reference; it's set by dependency injection so long as there is a service available that implements MessageGatewayService.
Message was edited by: Antony Hutchison
Hmmm I'm getting null on that, but it is working fine on my slingservlet.
Hi Antony Hutchison,
It is already configured, I can sent the email from my slingservlet, but I am not able to send it from my POJO class.
The com.day.cq.cq-mailer is also active on my OSGI Console.