Skip to main content

glassfish 3 undeploy provides application errors

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2010-10-08

Hello. I have a ear application (web-service, web + ejb module). My web service module handles many complex and long (up to few min) requests and calls many ejbs from ejb module. There is a big chance that some web service method is working when i need to undeploy\redeploy ear application. In this case i have an error at line 5 in code like this:

1 @WebMethod
2 public String someWebServiceMethod(){
3 ejb1.someMethod();
4 ......... // Complex work or wait IO
5 ejb2.someMethod2();// throw an EJBException
6 }

This code throws an javax.ejb.EJBException: Attempt to invoke when container is in Undeployed.
This happens because an application cannot call EJB that already undeployed (while someWebServiceMethod works at line 4)

Is there an default glassfish 3 mechanisms to avoid this situations ? Like a option "wait until live requests are completed before start an undeloy but do not accept a new requests" or any other option ? Should I handle this situation manualy by monitoring active connections on nginx and swith a port ? Can you recommend me best practice ?