users@glassfish.java.net

the dependency does't work

From: <glassfish_at_javadesktop.org>
Date: Mon, 22 Sep 2008 18:55:35 PDT

I had created a JavaMail Session Resource with the glassfish UI administion tool.
And the code which contained in a EJBproject does't work, a NullPointerException return!

code :

@Resource(name="mailSession")
        javax.mail.Session session;
private void doTest() {
                InitailContext ic=new InitialContext();
                System.out.println(session.toString());
        }
And I use the method InitialContext.list("") to list all contents, I find the resource I created among them!

How to resolve it, and make the dependency work correctly?
[Message sent by forum member 'prospectyang' (prospectyang)]

http://forums.java.net/jive/thread.jspa?messageID=300907