[jboss-user] [JBoss Seam] - Logger object nulled after passivation
pdpantages
do-not-reply at jboss.com
Sat Aug 11 15:01:35 EDT 2007
Hello forum:
Seam 1.2.1.GA,
Jboss 4.0.5
I have a problem with my Logger disappearing on me.
This seems to happen if I don't touch its containing component ( a SFSB ) for > 5 mins. The bean is passivated. When it is re-activated, the logger is null.
My scenario is this:
I have a long running conversation continaing two components, say bean1, bean2.
Both components are SFSB, Conversational, scope CONVERSATION.
The operator can move between two pages, within the same long runnig conversation, to interact with one component or the other.
I have an ajax poll that touches the page's backing bean when the operator is on the page.
The poll keeps the page up to date and keeps the conversation from timing out if the operator doesn't touch it, as long as the browser or tab is not closed.
Each page polls its own bean but not the other pages's bean.
So, when the operator hangs around the second page for >5 minutes, bean1 is passivated.
Thank when he returns to the fist page, bean1 is re-activated, and the first ajax poll throws an NPE when it tries to print a log message.
This happens cases where I have a single conversation or use nested conversations for the two pages involved.
I saw the commentary in
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=110879
which says that injected objects are not passivated as they are cleared after invocation. Is hte @Logger Log treated differently? It is non-null before passivation (see below) but is cleared after.
My logger is injected with the usual:
| @Logger
| private Log log;
|
Some debug statements in bean1:
| @PrePassivate
| public void prePasivate()
| {
| System.out.println("PDP prePasivate()");
| System.out.println("PDP log is " + log );
| }
|
| @PostActivate
| public void postActive()
| {
| System.out.println("PDP postActive()");
| System.out.println("PDP log is " + log );
| }
|
The output:
anonymous wrote :
| PDP prePasivate()
| PDP log is org.jboss.seam.log.LogImpl at dbbc62
| PDP postActive()
| PDP log is null
|
Any ideas would be appreciaed...
Thanks, PdP
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073314#4073314
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073314
More information about the jboss-user
mailing list