You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by Thomas Andraschko <to...@yahoo.de> on 2011/02/16 17:03:10 UTC

How OWB stores @SessionScoped beans in Web app?

Hi,

I successfully use Tomcat + Memcached Session Manager to replicate my session and JSF @SessionScoped beans.
Now i tried to use OWB + Memcached SessionManager and it does not working.

So my questions are: 
How OWB stores CDI @SessionScoped beans in a Web/JSF app? 
Can a OWB application be clustered?

Thanks!



Re: How OWB stores @SessionScoped beans in Web app?

Posted by Thomas Andraschko <to...@yahoo.de>.
Hi,

I also tried it without msm/clustering but with activated OWB failover.
 AFAICS the ViewExpiredException only occurs with activated OWB failover and msm (Maybe it also occurs with default tomcat clustering?)

Also note: The ViewExpiredException occurs on the first request without any failover or loadbalacing!

Here is the exception:

javax.faces.application.ViewExpiredException: /test.xhtmlNo saved view state could be found for the view identifier: /test.xhtml
    at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
    at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
    at de.javakaffee.web.msm.SessionTrackerValve.invoke(SessionTrackerValve.java:110)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

--- Martin Grotzke <ma...@googlemail.com> schrieb am Fr, 18.2.2011:

Von: Martin Grotzke <ma...@googlemail.com>
Betreff: Re: How OWB stores @SessionScoped beans in Web app?
An: user@openwebbeans.apache.org
Datum: Freitag, 18. Februar, 2011 18:17 Uhr

Hi Thomas,
can you clear cookies and try again? If you're still getting the exception, can you post the stacktrace / log output?
Cheers,Martin



On Fri, Feb 18, 2011 at 5:44 PM, Thomas Andraschko <to...@yahoo.de> wrote:


Hi,

Thanks for your answers!

I tried to activate the failover but now i get a ViewExpiredException from Myfaces.


I use: MyFaces 2.0.4, OWB 1.0.0, Tomcat 7.0.8 with the memcached manager.

There was no ViewExpiredException before i activated the failover.

Any ideas?

--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am Fr, 18.2.2011:



Von: Gurkan Erdogdu <gu...@yahoo.com>
Betreff: Re: How OWB stores @SessionScoped beans in Web app?


An: user@openwebbeans.apache.org
Datum: Freitag, 18. Februar, 2011 16:59 Uhr



Hi

FailOverService is disabled on default OWB configuration. You have to enable it.

Create openwebbeans.properties in META-INF/openwebbeans/openwebbeans.properties and add it into classpath

Write those contents into it



configuration.ordinal=100
org.apache.webbeans.web.failover.issupportfailover=true
org.apache.webbeans.web.failover.issupportpassivation=true









Regards;

--Gurkan



From: Joseph Bergmark <be...@apache.org>
To: user@openwebbeans.apache.org


Sent: Wed, February 16, 2011 7:56:38 PM
Subject: Re: How OWB stores @SessionScoped beans in Web app?

 OWB stores @SessionScoped beans in an in-memory map of SessionContext's that is keyed off the session id.


I believe the FailOverService will later store those SessionContext's as a session attribute in the session as part of the FailOverBagWrapper at
 the end of each request.  It should then serialize/restore as appropriate when the session is serialized.

Sincerely,
Joe

On Wed, Feb 16, 2011 at 11:03 AM, Thomas Andraschko <to...@yahoo.de> wrote:



Hi,



I successfully use Tomcat + Memcached Session Manager to replicate my session and JSF @SessionScoped beans.

Now i tried to use OWB + Memcached SessionManager and it does not working.



So my questions are:

How OWB stores CDI @SessionScoped beans in a Web/JSF app?

Can a OWB application be clustered?



Thanks!







 





-- 
Martin Grotzke
http://www.javakaffee.de/blog/







Re: How OWB stores @SessionScoped beans in Web app?

Posted by Martin Grotzke <ma...@googlemail.com>.
Hi Thomas,

can you clear cookies and try again? If you're still getting the exception,
can you post the stacktrace / log output?

Cheers,
Martin


On Fri, Feb 18, 2011 at 5:44 PM, Thomas Andraschko
<to...@yahoo.de>wrote:

> Hi,
>
> Thanks for your answers!
>
> I tried to activate the failover but now i get a ViewExpiredException from
> Myfaces.
> I use: MyFaces 2.0.4, OWB 1.0.0, Tomcat 7.0.8 with the memcached manager.
>
> There was no ViewExpiredException before i activated the failover.
>
> Any ideas?
>
> --- Gurkan Erdogdu *<gu...@yahoo.com>* schrieb am *Fr, 18.2.2011:
> *
>
> *
> Von: Gurkan Erdogdu <gu...@yahoo.com>
> Betreff: Re: How OWB stores @SessionScoped beans in Web app?
> An: user@openwebbeans.apache.org
> Datum: Freitag, 18. Februar, 2011 16:59 Uhr
>
> *
> *Hi
>
> FailOverService is disabled on default OWB configuration. You have to
> enable it.
>
> Create openwebbeans.properties in
> META-INF/openwebbeans/openwebbeans.properties and add it into classpath
>
> Write those contents into it
>
> configuration.ordinal=100
> org.apache.webbeans.web.failover.issupportfailover=true
> org.apache.webbeans.web.failover.issupportpassivation=true
> *
>  *Regards;
>
> --Gurkan
> *
> *
> *
> *
> ------------------------------
> From: Joseph Bergmark <be...@apache.org>
> To: user@openwebbeans.apache.org
> Sent: Wed, February 16, 2011 7:56:38 PM
> Subject: Re: How OWB stores @SessionScoped beans in Web app?
>
> OWB stores @SessionScoped beans in an in-memory map of SessionContext's
> that is keyed off the session id.*
> *
> *
> *I believe the FailOverService will later store those SessionContext's as
> a session attribute in the session as part of the FailOverBagWrapper at the
> end of each request.  It should then serialize/restore as appropriate when
> the session is serialized.*
> *
> *
> *Sincerely,*
> *
> *
> *Joe
>
> *
> *On Wed, Feb 16, 2011 at 11:03 AM, Thomas Andraschko <
> tommygrassman@yahoo.de <ht...@yahoo.de>>wrote:
> *
>
> *Hi,
>
> I successfully use Tomcat + Memcached Session Manager to replicate my
> session and JSF @SessionScoped beans.
> Now i tried to use OWB + Memcached SessionManager and it does not working.
>
> So my questions are:
> How OWB stores CDI @SessionScoped beans in a Web/JSF app?
> Can a OWB application be clustered?
>
> Thanks!
>
>
> *
>
> *
> *
> * *
> *
> *
>
>
>


-- 
Martin Grotzke
http://www.javakaffee.de/blog/

Re: How OWB stores @SessionScoped beans in Web app?

Posted by Thomas Andraschko <to...@yahoo.de>.
Hi,

Thanks for your answers!

I tried to activate the failover but now i get a ViewExpiredException from Myfaces.
I use: MyFaces 2.0.4, OWB 1.0.0, Tomcat 7.0.8 with the memcached manager.

There was no ViewExpiredException before i activated the failover.

Any ideas?

--- Gurkan Erdogdu <gu...@yahoo.com> schrieb am Fr, 18.2.2011:

Von: Gurkan Erdogdu <gu...@yahoo.com>
Betreff: Re: How OWB stores @SessionScoped beans in Web app?
An: user@openwebbeans.apache.org
Datum: Freitag, 18. Februar, 2011 16:59 Uhr

Hi

FailOverService is disabled on default OWB configuration. You have to enable it.

Create openwebbeans.properties in META-INF/openwebbeans/openwebbeans.properties and add it into classpath

Write those contents into it

configuration.ordinal=100
org.apache.webbeans.web.failover.issupportfailover=true
org.apache.webbeans.web.failover.issupportpassivation=true







Regards;

--Gurkan

From: Joseph Bergmark <be...@apache.org>
To: user@openwebbeans.apache.org
Sent: Wed, February 16, 2011 7:56:38 PM
Subject: Re: How OWB stores @SessionScoped beans in Web app?

 OWB stores @SessionScoped beans in an in-memory map of SessionContext's that is keyed off the session id.
I believe the FailOverService will later store those SessionContext's as a session attribute in the session as part of the FailOverBagWrapper at
 the end of each request.  It should then serialize/restore as appropriate when the session is serialized.

Sincerely,
Joe

On Wed, Feb 16, 2011 at 11:03 AM, Thomas Andraschko <to...@yahoo.de> wrote:

Hi,



I successfully use Tomcat + Memcached Session Manager to replicate my session and JSF @SessionScoped beans.

Now i tried to use OWB + Memcached SessionManager and it does not working.



So my questions are:

How OWB stores CDI @SessionScoped beans in a Web/JSF app?

Can a OWB application be clustered?



Thanks!







 




Re: How OWB stores @SessionScoped beans in Web app?

Posted by Gurkan Erdogdu <gu...@yahoo.com>.
Hi

FailOverService is disabled on default OWB configuration. You have to enable it.

Create openwebbeans.properties in META-INF/openwebbeans/openwebbeans.properties 
and add it into classpath

Write those contents into it

configuration.ordinal=100
org.apache.webbeans.web.failover.issupportfailover=true
org.apache.webbeans.web.failover.issupportpassivation=true

 Regards;

--Gurkan




________________________________
From: Joseph Bergmark <be...@apache.org>
To: user@openwebbeans.apache.org
Sent: Wed, February 16, 2011 7:56:38 PM
Subject: Re: How OWB stores @SessionScoped beans in Web app?

OWB stores @SessionScoped beans in an in-memory map of SessionContext's that is 
keyed off the session id.

I believe the FailOverService will later store those SessionContext's as a 
session attribute in the session as part of the FailOverBagWrapper at the end of 
each request.  It should then serialize/restore as appropriate when the session 
is serialized.

Sincerely,

Joe


On Wed, Feb 16, 2011 at 11:03 AM, Thomas Andraschko <to...@yahoo.de> 
wrote:

Hi,
>
>I successfully use Tomcat + Memcached Session Manager to replicate my session 
>and JSF @SessionScoped beans.
>Now i tried to use OWB + Memcached SessionManager and it does not working.
>
>So my questions are:
>How OWB stores CDI @SessionScoped beans in a Web/JSF app?
>Can a OWB application be clustered?
>
>Thanks!
>
>
>



Re: How OWB stores @SessionScoped beans in Web app?

Posted by Joseph Bergmark <be...@apache.org>.
OWB stores @SessionScoped beans in an in-memory map of SessionContext's that
is keyed off the session id.

I believe the FailOverService will later store those SessionContext's as a
session attribute in the session as part of the FailOverBagWrapper at the
end of each request.  It should then serialize/restore as appropriate when
the session is serialized.

Sincerely,

Joe

On Wed, Feb 16, 2011 at 11:03 AM, Thomas Andraschko
<to...@yahoo.de>wrote:

> Hi,
>
> I successfully use Tomcat + Memcached Session Manager to replicate my
> session and JSF @SessionScoped beans.
> Now i tried to use OWB + Memcached SessionManager and it does not working.
>
> So my questions are:
> How OWB stores CDI @SessionScoped beans in a Web/JSF app?
> Can a OWB application be clustered?
>
> Thanks!
>
>
>