mail-resource Mail session

Andreas Ernst <[email protected]> Sun, 9 Sep 2018 17:21:43 +0200
Newsgroups gmane.comp.java.tapestry.user
Message-ID <[email protected]>
Hi,

i try to access a Payara Mailsession (mail-resource), but it is always null:

@Stateless
public class MailSessionBean {

   private static final Logger logger = 
Logger.getLogger(MailSessionBean.class.getName());
   @Resource(name = "mail/motdSession")
   private Session mailSession;

   public void sendEmail(String to, String subject, String body) {
     MimeMessage message = new MimeMessage(mailSession);
     logger.log(Level.INFO, "### mailSession.sendEmail: {0}", mailSession);

mailSession is null. I added the class to AppModule:

public static void bind(ServiceBinder binder) {
   binder.bind(MailSessionBean.class);

but nothing helped, anybody how has this running. Google doesn't really 
help.

Thanks
Andy
-- 
ae | Andreas Ernst | IT Spektrum
Postfach 5, 65612 Beselich
Schupbacher Str. 32, 65614 Beselich, Germany
Tel: +49-6484-91002 Fax: +49-6484-91003
[email protected] | www.ae-online.de
www.tachyon-online.de

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]