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
a...@ae-online.de | www.ae-online.de
www.tachyon-online.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to