Converstaion context destroyed, why?
baz Apr 27, 2006 8:59 AMHello,
i am currently adding Seam support to an Webapp composed with myfaces and facelets. Seam is very useful in this case. The app is easier to understand and uses lesser code.:-)
But i have one problem for which i cannot determine the cause:
the conversation scope is destroyed without calling a method annotated with @End.
For the following log i will describe what i have doen in the app:
I called this method of analysisBacking:
@Begin(nested=true) public String addPCRAnalysis() { analysis = new PCRAnalysis(); analysis.setExperiment(experiment); return "ADD_ANALYSIS"; }
It results in rendering the new page, and the conversation is correctly listed in the conversationList ( i have borrowed the list from a seam example).
Now i am filling in some required fields and press a button which calls this method:
@Begin(nested=true) public String assignSamples() { Set<Sample> sampleSet = analysis.getExperiment().getSampleSet(); Set<Sample> analysisSamples = new HashSet<Sample>(); for (Sample sample : sampleSet) { analysisSamples.add(sample); } sampleData.setSampleData(analysisSamples); getAnalysis().setSamples(analysisSamples); return "ASSIGN_SAMPLES"; }
Now i am on a page where i can select samples. The converstaion list shows two conversations.
But after rendering this page, the log is like the following. The conversations seem to be destroyed.
14:31:44,968 DEBUG org.jboss.seam.contexts.Contexts: found in conversation context: analysisBacking
14:31:44,968 DEBUG org.jboss.seam.jsf.SeamVariableResolver: resolved name to seam component
14:31:44,968 DEBUG org.jboss.seam.contexts.Contexts: found in session context: bazProject
14:31:44,968 DEBUG org.jboss.seam.contexts.Contexts: found in conversation context: sampleData
14:31:44,968 DEBUG org.jboss.seam.contexts.Contexts: found in session context: experiment
14:31:44,968 DEBUG org.jboss.seam.jsf.SeamPhaseListener: Before saving state
14:31:44,968 DEBUG org.jboss.seam.core.Manager: Storing conversation state: 14
14:31:44,968 DEBUG org.jboss.seam.jsf.SeamPhaseListener: Before saving state
14:31:44,968 DEBUG org.jboss.seam.core.Manager: Storing conversation state: 14
14:31:44,984 DEBUG org.jboss.seam.jsf.SeamVariableResolver: resolving name: ScopeContainer
14:31:44,984 DEBUG org.jboss.seam.Component: seam component not found: ScopeContainer
14:31:44,984 DEBUG org.jboss.seam.jsf.SeamVariableResolver: resolved name to managed bean
14:31:44,984 DEBUG org.jboss.seam.util.Naming: JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
14:31:44,984 DEBUG org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener: committing transaction
14:31:44,984 DEBUG org.jboss.seam.util.Naming: JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
14:31:44,984 DEBUG org.jboss.seam.contexts.Lifecycle: After render response, destroying contexts
14:31:44,984 DEBUG org.jboss.seam.contexts.Lifecycle: destroying event context
14:31:44,984 DEBUG org.jboss.seam.contexts.Contexts: destroying: org.jboss.seam.core.manager
14:31:44,984 DEBUG org.jboss.seam.contexts.Lifecycle: flushing server-side conversation context
14:31:44,984 DEBUG org.jboss.seam.contexts.Lifecycle: <<< End web request
14:31:44,984 DEBUG org.apache.myfaces.component.html.util.ReducedHTMLParser: DOCTYPE found at line 1
14:31:44,984 DEBUG org.apache.myfaces.component.html.util.ReducedHTMLParser: DOCTYPE found at line 21
So any action (button click or so) ended up in this exception:
14:32:32,203 DEBUG org.apache.myfaces.context.servlet.ServletExternalContextImpl: Incoming request has Content-Type header without character encoding: application/x-www-form-urlencoded
14:32:32,203 DEBUG org.jboss.seam.util.Naming: JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
14:32:32,203 DEBUG org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener: beginning transaction
14:32:32,203 DEBUG org.jboss.seam.util.Naming: JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
14:32:32,203 DEBUG org.jboss.seam.contexts.Lifecycle: >>> Begin web request
14:32:32,234 DEBUG org.jboss.seam.jsf.SeamVariableResolver: resolving name: analysisBacking
14:32:32,234 DEBUG org.jboss.seam.Component: instantiating Seam component: analysisBacking
14:32:32,234 ERROR org.jboss.seam.servlet.SeamExceptionFilter: uncaught exception handled by Seam
javax.servlet.ServletException: No conversation context active
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23)
I have no clue why the contexts are destroyed. This is one of several examples of this behaviour.
On one page i could eliminate the problem simply by removing an overseen <t:savestate>
Any help or hint will be welcome.
What can i do to retrieve the reason why the contexts are destroyed?
Ciao,
Carsten