users@glassfish.java.net

Re: [urgent] problem in starting server when the app already deployed

From: <glassfish_at_javadesktop.org>
Date: Sat, 30 Aug 2008 23:30:46 PDT

Are the WAR and EJBs in the same EAR? Or are they separate?

Have you tried moving the initialization code to a dedicated InitServlet (my term for a dedicated Servlet used only for its init() method combined with using the load-on-startup tag in the web.xml) instead of a Context Listener?

Have you tried a simple test case with nothing more than a Context Listener trying to get something via the InitialContext, just to see if you can isolate it?

This works for me in a load-on-startup servlet, but I agree it's likely in a different part of the container lifecycle. Also, the servlet is not part of the EAR, but a separate WAR (the EAR is deployed on the same server, however). I also have a retry loop there to make sure that if my lookup fails, it sleeps and gives it a couple of more chances -- thought to be frank I'm not sure I actually still need that part.

If practical, I would take a stab at using an InitServlet and see if that can work around the problem for you.

Sorry this is coming almost 20hrs later than your post, but what can you do.

Good luck, and do let us know what you find out one way or the other. If this does NOT work, no doubt someone better versed in this area than me will want a thread dump (or two), so you may want to get some of those going as well.
[Message sent by forum member 'whartung' (whartung)]

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