users@glassfish.java.net

hot-deploy of EJB causes NoSuchEJBException in Servlet

From: <forums_at_java.net>
Date: Wed, 16 Mar 2011 09:48:23 -0500 (CDT)

 Hi, 
I'm currently having a try with EJB 3.1 and Glassfish 3.1 in Eclipse. 

This is what my project looks like:
- one EJB project (@Singleton) and one Utility Module project with the
bean's remote interface (@Remote)
- one ear that contains the EJB
- one war with a servlet that uses the beans remote interface (@EJB
annotation)

I have deployes ear and war to the glassfish using the eclipse integration
and everything works fine.
When I change anything in the ejb's implementation (e.g. changing the console
output done in a method that is called by the servlet) and try to call the
EJB again from the servlet, I get a NoSuchEJBException.
I can workarround this by using the initial context and doing a lookup for
the bean everytime I want to use it. Additionally I found this post that
proposes another solution
(http://stackoverflow.com/questions/4667410/javax-ejb-nosuchejbexception-after-redeploying-ejbs/4678040#4678040
[1])

Nevertheless, I wonder why it behaves like this. The server seems to now that
the old ejb is no longer existing. So why doesn't he just do a lookup for a
new one?!

Regards, Martin


[1]
http://stackoverflow.com/questions/4667410/javax-ejb-nosuchejbexception-after-redeploying-ejbs/4678040#4678040

--
[Message sent by forum member 'm.wahnschaffe']
View Post: http://forums.java.net/node/782092