users@glassfish.java.net

EJB Deployment Issue

From: Jason Lee <lee_at_iecokc.com>
Date: Tue, 1 May 2007 17:11:18 -0500

We're really struggling with an issue right now with regard to EJB
(re)deployment. Let's say we have ProjA with a remote SLSB, and ProjB,
also with a remote SLSB into which ProjA's bean is injected. ProjB's
SLSB is then injected into ProjB's session-scoped JSF-managed bean.
 
ProjA->ProjB->ProjBManagedBean
 
Things work fine until we redeploy/update ProjA, at which point any
calls to ProjA from ProjB fails: javax.ejb.NoSuchEJBException
 
My theory is that ProjB is holding on to a reference to an instance of
ProjA that is no longer there due to the redeployment. The problem may
be caused or exacerbated by the fact that we're injecting into a
session-scoped bean, but I just tested with a request-scoped bean and
got the same error, so the problem may lie with a dangling reference in
ProjB's SLSB.
 
How is this best handled? Brainstorming brought up @AroundInvoke to
check the validity of th reference or to look it up again, but that kind
defeats the purpose of injection and could cause some pretty severe
performance problems. Is there a way to make these references
self-healing? I sure hope so... :|
-----
Jason Lee, SCJP
Senior Software Engineer
http://www.iec-okc.com <http://www.iec-okc.com/>