|
From: Colin S. <col...@ex...> - 2003-12-12 19:29:08
|
I've made the logger non-final so that stateful session bean subclasses
can remove and restore it in ejbPassivate/ejbActivate, respectively.
I considered nulling out the BeanFactoryLoader automatically on the
unload call. On the other hand, I don't think this is always appropriate
since some people don't use the default loader. I use my own loader for
example, which is serializable, so there is no need to reset it each
time (although I'm not using stateful beans anyways).
Alastair Rodgers wrote:
>Hi,
>
>I've only just subscribed to the dev list, but someone told me there was a discussion earlier this week about failure to passivate stateful session beans. This was caused by the bean factory reference not being set to null on passivation.
>
>I've come across a related problem, which seems to be due to the logger field in AbstractEnterpriseBean - I can't set its reference to null in ejbPassivate() because its final, so when my bean tries to passivate I get an exception saying that org.apache.commons.logging.impl.Log4JCategoryLog is not serializable (stacktrace below).
>
>Also, I've just taken a look at AbstractEnterpriseBean in CVS and it seems that unloadBeanFactory() only sets the ref to beanFactory to null, whereas the beanFactoryLoader ref remains set. I know I could just call setBeanFactoryLoader() in ejbPassivate() to set it to null, but wouldn't it be clearer to just have a single unload() method which unloads both references?
>
>Anyway, that aside, Spring is fantastic! Thanks.
>
>Al.
>
>
>
>javax.ejb.EJBException: Could not passivate; failed to save state; CausedByException is:
> org.apache.commons.logging.impl.Log4JCategoryLog
> at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:378)
> at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:85)
> at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:156)
> at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:435)
> at java.util.TimerThread.mainLoop(Timer.java:432)
> at java.util.TimerThread.run(Timer.java:382)
>java.io.NotSerializableException: org.apache.commons.logging.impl.Log4JCategoryLog
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
> at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
> at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
> at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:370)
> at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:85)
> at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:156)
> at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:435)
> at java.util.TimerThread.mainLoop(Timer.java:432)
> at java.util.TimerThread.run(Timer.java:382)
>N?HY隊X???'???u?????S??+??l?(??{^?ا,?T^???l???z|???$?YlJ('??謀L?Z?x????j[y??z???b??kay????^?[h?+vh?
>X??z0??i????&?bt
>?ƥ??"t
>?Z)?rD??)?~??{
>+?ׯzZ)z???X??X??*k?x????u?ޖ?^?X???(??~??zw???i????l???q???z???l?X??)ߣ?)?)?~??{
>+?ׯzZ)er==
>
|