Okay for those of you interested in the work around to my problem (listed below).
 
I think the servlet init method only gets called once no matter how many instances of the servlet exist. Hence,
when you remove the ejb there is nothin re-creating it.
 
Solution: before calling the bean make sure it is not equal to null, if it is re-create it. Also when  you remove() it, make sure you set it to null.
 
That's all.
 
If anyone disagrees with my logic please let me know.
 
Ricardo
 
 
Hello I have been trying to look for info on this problem and I have not
found anything useful.

Let me describe my problem.

I have an applet that accesses a servlet that in turn communicates with an
EJB.

in the Applet.destroy() I send a request to my servlet called "endSession"
this gets handled by my servlet
wich in turn calls the local reference of my beans remove method that is
beanLocal.remove();

This appears to end the session just fine, but when I try and make use of
that bean again it gives me the following error:

16:03:11,181 ERROR [AbstractInstanceCache] Activation failure
javax.ejb.EJBException: Could not activate; CausedByException is:

C:\Programme\jboss-3.0.1\server\default\db\sessions\Controller\103659469
7323.ser (Das System kann die angegebene Datei nicht finden)
        at
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateS
ession(StatefulSessionFilePersistenceManager.java:239)
        at
org.jboss.ejb.plugins.StatefulSessionInstanceCache.activate(StatefulS
essionInstanceCache.java:83)
        at
org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache
.java:177)
        at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(State
fulSessionInstanceInterceptor.java:212)
        at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:107)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:178)
        at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
0)
        at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:203)
        at
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContaine
....etc.

I've read in some places that this has to do with the max-bean-age in the
config file.

As I understand it one you call this method there is a discrepancy between
what was passivated and what the new ejb local
object.

I don't really understand this problem as I am able to call the beanRemote.r
emove() method without getting the above error stack.

So my question is how can I end the EJB session when the applet is
destroyed? and why can't I use the beanLocal.remove() method.

Thancks,

Ricardo

Reply via email to