users@glassfish.java.net

Re: calling of _at_PostConstruct on MDB?

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Jul 2008 07:13:58 PDT

Hi,

in the meanwhile a colleague helped me out with a workaround for this.
If the @PostConstruct method is called ejbCreate() (as in EJB2.x) it is always working. Or the PostConstruct method has to be defined in the deployment descriptor.

This is some very strange behaviour.

Now I'm trying to figure out how I can access my env-entry from the bean.
I set it like this in the ejb-jar.xml:
<env-entry>
                                <description>description</description>
                                <env-entry-name>someString</env-entry-name>
                                <env-entry-type>java.lang.String</env-entry-type>
                                <env-entry-value>foobar</env-entry-value>
</env-entry>

But when trying to access this with:
final String envString = (String)namingContext.lookup( "java:comp/env/someString" );
it fails, claiming NameNotFound: "java:comp/env/someString"

I also tried to inject this via @Resource and <injection-target> but to no avail.

Cheers
Chris
[Message sent by forum member 'chrjohn' (chrjohn)]

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