You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Svilen Ivanov <sv...@gmail.com> on 2007/08/27 13:00:58 UTC

Clustering MyFaces application with Tomcat

I'm trying to cluster a certain MyFaces (1.1.5, tomahawk 1.1.6)
application in Tomcat 5.5.20. The applications heavily relies on
session beans which use ListDataModel and HtmlDataScroller as
properties. When I setup Tomcat to replicate sessions I got
NotSerializableException for HtmlDataScroller.

As far as I understood from MyFaces FAQ [2] list data model is not
serializable and may be marked "transient". Some guys recommend to
build new data model out of a list [1] each time data model is
requested. However I couldn't find how to solve the problem with
HtmlDataScroller.

My initial idea is to subclass MyFaces classes I use in the session
beans and make them implement Serializable interface. How does this
sound?

Also I have bindings of input controls (HtmlInputText,
HtmlSelectOneRadio) in these session beans. Are they also stateless as
ListDataModel?

I would really appreciate if you share your experience with clustering
MyFaces application as well or if you point me towards resources on
the Internet that might help

Regards,
Svilen

[1] http://www.mail-archive.com/users@myfaces.apache.org/msg38166.html
[2] http://wiki.apache.org/myfaces/FAQ

-- 
Svilen Ivanov
http://svilen-online.blogspot.com

There is no dark side of the moon really.
Matter of fact it's all dark.

Re: Clustering MyFaces application with Tomcat

Posted by Adrian Mitev <ad...@googlemail.com>.
When the reponse is rendered jsf serializes the components tree state in
order to be restored on postback and releases the uicomponent tree to free
the memory. If you have session scoped reference to the tree jsf releases it
but it cannot be cleared by the GC because you "hold" it in your session
scoped bean.

2007/8/28, Svilen Ivanov <sv...@gmail.com>:
>
> Adrian,
>
> Thank you for your reply.
>
> Do you mean by "you don't allow jsf to clear the tree" - the tree of
> UI components or the values stored in the UI components that are
> bound? In the latter case I noticed that bound components in session
> bean persist their input values until I manually reset them (as
> described here [1]. Am I understanding you correctly?
>
> Regards,
> Svi
>
>
> [1] http://www.mail-archive.com/users@myfaces.apache.org/msg40105.html
>
>
> 2007/8/28, Adrian Mitev <ad...@googlemail.com>:
> > Binding to jsf components should be done using request scoped beans only
> > (with session scope bean you don't allow jsf to clear the tree after the
> > request is processed).
> >
> > 2007/8/27, Svilen Ivanov < svilen.ivanov@gmail.com>:
> > > I'm trying to cluster a certain MyFaces ( 1.1.5, tomahawk 1.1.6)
> > > application in Tomcat 5.5.20. The applications heavily relies on
> > > session beans which use ListDataModel and HtmlDataScroller as
> > > properties. When I setup Tomcat to replicate sessions I got
> > > NotSerializableException for HtmlDataScroller.
> > >
> > > As far as I understood from MyFaces FAQ [2] list data model is not
> > > serializable and may be marked "transient". Some guys recommend to
> > > build new data model out of a list [1] each time data model is
> > > requested. However I couldn't find how to solve the problem with
> > > HtmlDataScroller.
> > >
> > > My initial idea is to subclass MyFaces classes I use in the session
> > > beans and make them implement Serializable interface. How does this
> > > sound?
> > >
> > > Also I have bindings of input controls (HtmlInputText,
> > > HtmlSelectOneRadio) in these session beans. Are they also stateless as
> > > ListDataModel?
> > >
> > > I would really appreciate if you share your experience with clustering
> > > MyFaces application as well or if you point me towards resources on
> > > the Internet that might help
> > >
> > > Regards,
> > > Svilen
> > >
> > > [1]
> > http://www.mail-archive.com/users@myfaces.apache.org/msg38166.html
> > > [2] http://wiki.apache.org/myfaces/FAQ
> > >
> > > --
> > > Svilen Ivanov
> > > http://svilen-online.blogspot.com
> > >
> > > There is no dark side of the moon really.
> > > Matter of fact it's all dark.
> > >
> >
> >
>
>
> --
> Svilen Ivanov
> http://svilen-online.blogspot.com
>
> There is no dark side of the moon really.
> Matter of fact it's all dark.
>

Re: Clustering MyFaces application with Tomcat

Posted by Svilen Ivanov <sv...@gmail.com>.
Adrian,

Thank you for your reply.

Do you mean by "you don't allow jsf to clear the tree" - the tree of
UI components or the values stored in the UI components that are
bound? In the latter case I noticed that bound components in session
bean persist their input values until I manually reset them (as
described here [1]. Am I understanding you correctly?

Regards,
Svi


[1] http://www.mail-archive.com/users@myfaces.apache.org/msg40105.html


2007/8/28, Adrian Mitev <ad...@googlemail.com>:
> Binding to jsf components should be done using request scoped beans only
> (with session scope bean you don't allow jsf to clear the tree after the
> request is processed).
>
> 2007/8/27, Svilen Ivanov < svilen.ivanov@gmail.com>:
> > I'm trying to cluster a certain MyFaces ( 1.1.5, tomahawk 1.1.6)
> > application in Tomcat 5.5.20. The applications heavily relies on
> > session beans which use ListDataModel and HtmlDataScroller as
> > properties. When I setup Tomcat to replicate sessions I got
> > NotSerializableException for HtmlDataScroller.
> >
> > As far as I understood from MyFaces FAQ [2] list data model is not
> > serializable and may be marked "transient". Some guys recommend to
> > build new data model out of a list [1] each time data model is
> > requested. However I couldn't find how to solve the problem with
> > HtmlDataScroller.
> >
> > My initial idea is to subclass MyFaces classes I use in the session
> > beans and make them implement Serializable interface. How does this
> > sound?
> >
> > Also I have bindings of input controls (HtmlInputText,
> > HtmlSelectOneRadio) in these session beans. Are they also stateless as
> > ListDataModel?
> >
> > I would really appreciate if you share your experience with clustering
> > MyFaces application as well or if you point me towards resources on
> > the Internet that might help
> >
> > Regards,
> > Svilen
> >
> > [1]
> http://www.mail-archive.com/users@myfaces.apache.org/msg38166.html
> > [2] http://wiki.apache.org/myfaces/FAQ
> >
> > --
> > Svilen Ivanov
> > http://svilen-online.blogspot.com
> >
> > There is no dark side of the moon really.
> > Matter of fact it's all dark.
> >
>
>


-- 
Svilen Ivanov
http://svilen-online.blogspot.com

There is no dark side of the moon really.
Matter of fact it's all dark.

Re: Clustering MyFaces application with Tomcat

Posted by Adrian Mitev <ad...@googlemail.com>.
Binding to jsf components should be done using request scoped beans only
(with session scope bean you don't allow jsf to clear the tree after the
request is processed).

2007/8/27, Svilen Ivanov <sv...@gmail.com>:
>
> I'm trying to cluster a certain MyFaces (1.1.5, tomahawk 1.1.6)
> application in Tomcat 5.5.20. The applications heavily relies on
> session beans which use ListDataModel and HtmlDataScroller as
> properties. When I setup Tomcat to replicate sessions I got
> NotSerializableException for HtmlDataScroller.
>
> As far as I understood from MyFaces FAQ [2] list data model is not
> serializable and may be marked "transient". Some guys recommend to
> build new data model out of a list [1] each time data model is
> requested. However I couldn't find how to solve the problem with
> HtmlDataScroller.
>
> My initial idea is to subclass MyFaces classes I use in the session
> beans and make them implement Serializable interface. How does this
> sound?
>
> Also I have bindings of input controls (HtmlInputText,
> HtmlSelectOneRadio) in these session beans. Are they also stateless as
> ListDataModel?
>
> I would really appreciate if you share your experience with clustering
> MyFaces application as well or if you point me towards resources on
> the Internet that might help
>
> Regards,
> Svilen
>
> [1] http://www.mail-archive.com/users@myfaces.apache.org/msg38166.html
> [2] http://wiki.apache.org/myfaces/FAQ
>
> --
> Svilen Ivanov
> http://svilen-online.blogspot.com
>
> There is no dark side of the moon really.
> Matter of fact it's all dark.
>