Re: mail-resource Mail session

"Thiago H. de Paula Figueiredo" <[email protected]> Tue, 11 Sep 2018 09:13:19 -0300
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88GboGzdQUmAZ+JoAiKBaOWj93bf6mDojOj6Q4bWmt6O8AQ@mail.gmail.com>
On Sun, Sep 9, 2018 at 12:22 PM Andreas Ernst <[email protected]> wrote:

> Hi,
>

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;
>

Shouldn't you use @Inject instead of @Resource? What's the fully qualified
name of the @Stateless and @Resource annotations you're using?


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

This part is correct.

--
Thiago