users@glassfish.java.net

calling of _at_PostConstruct on MDB?

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Jul 2008 01:45:27 PDT

Hi,

I have a MDB here which was formerly EJB2.1 and I want to migrate this to EJB3. So far so good.
There are two deployment descriptors. One ejb-jar.xml and one sun-ejb-jar.xml.
In the ejb-jar.xml, there is an env-entry set that I want to fetch in the EJB. I'm doing this in the initialize() method which has the @PostConstruct annotation.

My question: Shouldn't the @PostConstruct method always be called? I have cases when this method isn't called at all which results in Exceptions when onMessage() is called.
The very strange thing is that it seems that the initialize() method is always called when I don't have the two deployment descriptors packaged. But I need the DDs for setting the env-entry.
I'm using Glassfish v2ur2.

Can anyone shed some light on this?? Thanks in advance and best regards,
Chris
[Message sent by forum member 'chrjohn' (chrjohn)]

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