Wednesday, August 27, 2008

com.ibm.ejs.container.HomeDisabledException

Look at this, pretty little exception:

javax.ejb.EJBException: See nested exception; nested exception is:

com.ibm.ejs.container.HomeDisabledException: Mayhem#MayhemEJB.jar#StatefulTimerBean com.ibm.ejs.container.HomeDisabledException: Mayhem#MayhemEJB.jar#StatefulTimerBean at com.ibm.ejs.container.EJSHome.homeEnabled(EJSHome.java:483) at com.ibm.ejs.container.EJSHome.getBeanMetaData(EJSHome.java:1620) at com.ibm.ejs.container.BeanId.getBeanMetaData(BeanId.java:395) at com.ibm.ejs.container.drs.SfDRSCache.faultDataIntoCache(SfDRSCache.java:526) at com.ibm.ejs.container.drs.SfDRSCache.beanDoesNotExistOrHasTimedOut(SfDRSCache.java:285) at com.ibm.ejs.container.StatefulBeanReaper.beanDoesNotExistOrHasTimedOut(StatefulBeanReaper.java:406) at com.ibm.ejs.container.activator.StatefulSessionActivationStrategy.atActivate(StatefulSessionActivationStrategy.java:213)


So, HomeDisabled, eh? I thought version 3.0 EJBs didn't have Homes? Well, I guess it's up to the container whether they do or not - it's really not my business, because I'm not using them.

So, what's the solution to this problem? Well, in this case, my bean SFSB was passivated, likely removed from the server when I "Cleaned the WebSphere Application Server in IRAD" and then, when I invoked it again, the bean was gone, nowhere to be found, as it was likely not just passivated, but completely removed from the container.

So, I guess when you invoke a Stateful Session Bean, you must be careful that it doesn't timeout, catch the EJB exception, and look it up again if it is expired or timed out. Does that sound right?

No comments: