|
From: MacMahon, M. <M.M...@em...> - 2004-01-06 12:40:29
|
Hi All,
I have got a package of Spring configured objects that I would like to use
interchangeably in both a web application and
an EJB application (from SFSB).
Some of my Objects are BeanFactoryAware so that they can create on demand,
prototype instances of spring configured objects.
All works well in web application mode. However I cannot get it to work
reliably in ejb mode due to the fact that BeanFactory is not serializable -
exceptions on passivation of the SFSB.
Why isn't BeanFactory serializable? I can see that the Log class is being
stored as a member rather than a class variable in some of the spring
classes but surely this can be changed easily?
Shouldn't the BeanFactoryWare interface be documented so as to discourage
use of it in beans that are used in an EJB environment?
Is there any way that I can avoid reverting back to using a typical java
singleton for access to the BeanFactory for the scenario that I have
described (loading prototypes on demand)
I am also getting problems passivating the SFSB due to the fact that
AbstractEnterpriseBean stores its logger as a member rather than a class
variable:
Is this convenience really worth sacrificing serializable support?
abstract class AbstractEnterpriseBean implements EnterpriseBean
{
/** Logger, available to subclasses */
protected final Log logger = LogFactory.getLog(getClass());
//Change to static to support serializable
//private final static Log logger =
LogFactory.getLog(AbstractEnterpriseBean.class);
}
Please forgive me if I am addressing the wrong mailing list here!
Any help appreciated!
Thanks in advance!
Mark
____________________________________________________
emuse technologies
U24 Trinity Enterprise Centre, Pearse Street, Dublin 2, Ireland.
Tel: +353 (0)1 6717317 Fax: +353 (0)1 6717319
website: <http://www.emusetechnologies.com/>
email: in...@em... <mailto:in...@em...>
____________________________________________________
This message has been scanned for viruses using GroupShield for Exchange
Server.
CONFIDENTIALITY NOTICE - The information contained in this email message is
intended only for confidential use of the named recipient. If the reader is
not the intended recipient or the person responsible for delivering it to
the recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination or copying of this
communication is strictly prohibited. If you have received this in error,
please notify the sender immediately.
The information, opinions and recommendations contained herein are and must
be construed solely as statements of opinion and not statements of fact. No
warranty, expressed or implied, as to the accuracy, timeliness,
completeness, merchantability or fitness for any particular purpose of any
such recommendation or information is given or made by emuse technologies in
any form or manner whatsoever.
|
|
From: Tim M. <tec...@mo...> - 2004-01-06 13:32:20
|
MacMahon, Mark wrote:
> Hi All,
>
<snip>
>
> I am also getting problems passivating the SFSB due to the fact that
> AbstractEnterpriseBean stores its logger as a member rather than a class
> variable:
> Is this convenience really worth sacrificing serializable support?
>
> abstract class AbstractEnterpriseBean implements EnterpriseBean
> {
>
> /** Logger, available to subclasses */
> protected final Log logger = LogFactory.getLog(getClass());
>
> //Change to static to support serializable
> //private final static Log logger =
> LogFactory.getLog(AbstractEnterpriseBean.class);
>
> }
>
I am working along with Mark on this issue and now have some further
points to note:
I see that there is now a note on the "logger" variable that it should
be reinitialised during activation for a stateful session bean. This has
been implemented (logger set to null during passivation) but we now
receive the following error during passivation:
javax.ejb.EJBException: Could not passivate; failed to save state;
CausedByException is:
org.springframework.aop.framework.Cglib2AopProxy
at
org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:378)
at
org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:85)
I have even set the logger on the Cglib2AopProxy to a static variable
but this did not help.
I do reiterate Mark's comments about the loggers used in the Spring
code. It would be much easier to use these classes if the loggers were
static. It may require a little more code placed in to initialise a
logger for the subclasses but the resulting stability would be worth it.
Currently it looks like we'll have to stop using Spring's stateful
session bean until it can be passivated successfully.
Once again, thanks for a great framework and looking forward to 1.0!
Tim McAuley
|
|
From: Alef A. <al...@jt...> - 2004-01-06 13:32:28
|
A serializable beanfactory in my opinion is not a really good option,
what about the beans it contains? Should they be serializable as well
(which is what a serializable beanfactory would indicate as far as I'm
concerned).
We use the BeanFactory in EJBs a lot and we declare it as being
transient and force re-initialization an activation. This just works
fine. When limiting the amount of beans in a BeanFactory for an EJB and
creating multiple beanfactories for multiple different EJBs, it
shouldn't be that big an overhead.
Alef
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...]
> On Behalf Of MacMahon, Mark
> Sent: Tuesday, January 06, 2004 1:34 PM
> To: 'spr...@li...'
> Subject: [Springframework-developer] Serializable support
>
>
>
> Hi All,
>
> I have got a package of Spring configured objects that I
> would like to use interchangeably in both a web application and
> an EJB application (from SFSB).
> Some of my Objects are BeanFactoryAware so that they can
> create on demand, prototype instances of spring configured objects.
>
> All works well in web application mode. However I cannot get
> it to work reliably in ejb mode due to the fact that
> BeanFactory is not serializable - exceptions on passivation
> of the SFSB.
>
> Why isn't BeanFactory serializable? I can see that the Log
> class is being stored as a member rather than a class
> variable in some of the spring classes but surely this can be
> changed easily?
>
>
> Shouldn't the BeanFactoryWare interface be documented so as
> to discourage use of it in beans that are used in an EJB environment?
>
> Is there any way that I can avoid reverting back to using a
> typical java singleton for access to the BeanFactory for the
> scenario that I have described (loading prototypes on demand)
>
>
> I am also getting problems passivating the SFSB due to the
> fact that AbstractEnterpriseBean stores its logger as a
> member rather than a class
> variable:
> Is this convenience really worth sacrificing serializable support?
>
> abstract class AbstractEnterpriseBean implements EnterpriseBean
> {
>
> /** Logger, available to subclasses */
> protected final Log logger = LogFactory.getLog(getClass());
>
> //Change to static to support serializable
> //private final static Log logger =
> LogFactory.getLog(AbstractEnterpriseBean.class);
>
> }
>
>
>
> Please forgive me if I am addressing the wrong mailing list here!
>
> Any help appreciated!
> Thanks in advance!
>
> Mark
>
> ____________________________________________________
>
> emuse technologies
> U24 Trinity Enterprise Centre, Pearse Street, Dublin 2, Ireland.
> Tel: +353 (0)1 6717317 Fax: +353 (0)1 6717319
> website: <http://www.emusetechnologies.com/>
> email: in...@em... <mailto:in...@em...>
> ____________________________________________________
>
> This message has been scanned for viruses using GroupShield
> for Exchange Server.
>
> CONFIDENTIALITY NOTICE - The information contained in this
> email message is intended only for confidential use of the
> named recipient. If the reader is not the intended recipient
> or the person responsible for delivering it to the recipient,
> you are hereby notified that you have received this
> communication in error and that any review, dissemination or
> copying of this communication is strictly prohibited. If you
> have received this in error, please notify the sender immediately.
>
> The information, opinions and recommendations contained
> herein are and must be construed solely as statements of
> opinion and not statements of fact. No warranty, expressed or
> implied, as to the accuracy, timeliness, completeness,
> merchantability or fitness for any particular purpose of any
> such recommendation or information is given or made by emuse
> technologies in any form or manner whatsoever.
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign
> up for IBM's Free Linux Tutorials. Learn everything from the
> bash shell to sys admin. Click now!
> http://ads.osdn.com/?ad_id=1278&alloc_id=> 3371&op=click
>
>
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|
|
From: Ross M. <ro...@at...> - 2004-01-06 22:35:09
|
Hi all,
A better solution would be to make the logger transient as it doesn't
really make sense to serialise (sorry, serialize ;-)) it. Plus i don't
think org.apache.commons.logging.Log or implementations are Serializable.
Cheers,
Ross
MacMahon, Mark wrote:
> Hi All,
>
> I have got a package of Spring configured objects that I would like to use
> interchangeably in both a web application and
> an EJB application (from SFSB).
> Some of my Objects are BeanFactoryAware so that they can create on demand,
> prototype instances of spring configured objects.
>
> All works well in web application mode. However I cannot get it to work
> reliably in ejb mode due to the fact that BeanFactory is not serializable -
> exceptions on passivation of the SFSB.
>
> Why isn't BeanFactory serializable? I can see that the Log class is being
> stored as a member rather than a class variable in some of the spring
> classes but surely this can be changed easily?
>
>
> Shouldn't the BeanFactoryWare interface be documented so as to discourage
> use of it in beans that are used in an EJB environment?
>
> Is there any way that I can avoid reverting back to using a typical java
> singleton for access to the BeanFactory for the scenario that I have
> described (loading prototypes on demand)
>
>
> I am also getting problems passivating the SFSB due to the fact that
> AbstractEnterpriseBean stores its logger as a member rather than a class
> variable:
> Is this convenience really worth sacrificing serializable support?
>
> abstract class AbstractEnterpriseBean implements EnterpriseBean
> {
>
> /** Logger, available to subclasses */
> protected final Log logger = LogFactory.getLog(getClass());
>
> //Change to static to support serializable
> //private final static Log logger =
> LogFactory.getLog(AbstractEnterpriseBean.class);
>
> }
>
>
>
> Please forgive me if I am addressing the wrong mailing list here!
>
> Any help appreciated!
> Thanks in advance!
>
> Mark
>
> ____________________________________________________
>
> emuse technologies
> U24 Trinity Enterprise Centre, Pearse Street, Dublin 2, Ireland.
> Tel: +353 (0)1 6717317 Fax: +353 (0)1 6717319
> website: <http://www.emusetechnologies.com/>
> email: in...@em... <mailto:in...@em...>
> ____________________________________________________
>
> This message has been scanned for viruses using GroupShield for Exchange
> Server.
>
> CONFIDENTIALITY NOTICE - The information contained in this email message is
> intended only for confidential use of the named recipient. If the reader is
> not the intended recipient or the person responsible for delivering it to
> the recipient, you are hereby notified that you have received this
> communication in error and that any review, dissemination or copying of this
> communication is strictly prohibited. If you have received this in error,
> please notify the sender immediately.
>
> The information, opinions and recommendations contained herein are and must
> be construed solely as statements of opinion and not statements of fact. No
> warranty, expressed or implied, as to the accuracy, timeliness,
> completeness, merchantability or fitness for any particular purpose of any
> such recommendation or information is given or made by emuse technologies in
> any form or manner whatsoever.
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
|