[jboss-user] [EJB 3.0 Development] New message: "Re: Lookup to java:comp/EJBContext during postconstruction"
jaikiran pai
do-not-reply at jboss.com
Wed Mar 10 00:55:50 EST 2010
User development,
A new message was posted in the thread "Lookup to java:comp/EJBContext during postconstruction":
http://community.jboss.org/message/530932#530932
Author : jaikiran pai
Profile : http://community.jboss.org/people/jaikiran
Message:
--------------------------------------------------------------
> marius.bogoevici wrote:
>
>
> public class MilkMan implements MessageListener
> {
>
> @PostConstruct
> public void doAfterConstruction()
> {
> try
> {
> Context context = ((Context) new InitialContext().lookup("java:comp/EJBContext"));
> }
> catch (NamingException e)
> {
> e.printStackTrace();
> }
> }
>
>
> }
>
>
>
> Now, I would really like to know whether this assessment is corect and if that is something that is essentially expected to happen given the circumstances. If this is expected behaviour, then I think that we could work around this by treating EJBContext distinctly when injecting resources, but if not, then what would you think that would be the appropriate solution for doing a correct lookup for the purposes of CDI/Weld integration?
It shouldn't fail. If it's failing, then it's a bug (looks like similar to the one we just fixed for EAP-4.x version). And i don't think it's specific to the EJBContext. I guess it will fail for anything under java:comp for that bean. Can you give a quick try by looking up something else under java:comp from within the @Postconstruct of MDB?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/530932#530932
More information about the jboss-user
mailing list