-
1. Re: @Conversational with s:link
lcoetzee Apr 13, 2006 11:49 AM (in response to lcoetzee)I have built a small application with a stateful bean annotated with @Conversational containing two methods:
@Stateful @Name("serviceManagementBean") @Conversational(ifNotBegunOutcome = "AdminHomePage") @Interceptors(SeamInterceptor.class) public class ServiceManagementBean implements Serializable, ServiceManagement { ..... public String doSomething() { logger.info("doSomething"); return null; } public String doSomethingElse() { logger.info("doSomethingElse. Ends conversation"); return null; }
and invoked from a view using s:link<s:link action="#{serviceManagementBean.doSomethingElse}" propagation="end"> <h:outputText value="Do Something else (End conversation)" /> </s:link> <s:link action="#{serviceManagementBean.doSomething}"> <h:outputText value="Do Something" /> </s:link>
When invoking "Do Something else..." the conversation is ended (and I return to same xhtml page). When I then execute "Do Something" it executes even though one would expect the Conversational to prevent if from executing and to force it to the ifNotBegunOutcome page.
Snippet from the log file:17:40:02,043 INFO [ServiceManagementBean] doSomethingElse. Ends conversation . . 17:40:18,414 INFO [ServiceManagementBean] doSomething
It might be a bug or possibly something in my environment preventing the Conversational to do its job. Comments ?
Regards
L -
2. Re: @Conversational with s:link
mirko27 Apr 13, 2006 12:17 PM (in response to lcoetzee)Havin' the same issue.
-
3. Re: @Conversational with s:link
gavin.king Apr 15, 2006 12:41 AM (in response to lcoetzee)If you're still seeing this problem, please submit your test app to JIRA. TIA.
-
4. Re: @Conversational with s:link
lcoetzee Apr 15, 2006 4:38 AM (in response to lcoetzee)Hi Gavin,
I have created an issue. See
http://jira.jboss.com/jira/browse/JBSEAM-206
Thanks
Louis -
5. Re: @Conversational with s:link
gavin.king Apr 15, 2006 10:33 PM (in response to lcoetzee)This is fixed in CVS. Please test it.
-
6. Re: @Conversational with s:link
lcoetzee Apr 16, 2006 1:27 PM (in response to lcoetzee)Thanks Gavin. The fix did the trick ! Much appreciated.
One more question... does the Conversational create a faces error message to display to the user why he/she got redirected ? I know that you added this functionality earlier (which worked), but at this point I don't see the message (although in the log file I can see an INFO message (but not an error/info message to display on the view)):INFO [ConversationInterceptor] no long-running conversation for @Conversational bean: viewBean
As an aside: this exception still pops up (directly after the above INFO message):ERROR [PhaseListenerManager] Exception in PhaseListener RENDER_RESPONSE(6) afterPhase java.lang.IllegalStateException: No active application scope at org.jboss.seam.core.Init.instance(Init.java:86) at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:156) at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.afterPhase(SeamExtendedManagedPersistencePhaseListener.java:53) at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:391) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138) 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.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23) 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.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.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) 19:21:51,671 INFO [ViewBean] Removed
Thanks again for this quick fix !
Regards
Louis -
7. Re: @Conversational with s:link
lcoetzee Apr 16, 2006 1:49 PM (in response to lcoetzee)Regarding my comment about the Conversational error message:
One more question... does the Conversational create a faces error message to display to the user why he/she got redirected ? I know that you added this functionality earlier (which worked), but at this point I don't see the message (although in the log file I can see an INFO message (but not an error/info message to display on the view)):
I see that you do create such an error message in ConversationInterceptor.java:log.info("no long-running conversation for @Conversational bean: " + component.getName()); FacesMessages.instance().addFromResourceBundle( FacesMessage.SEVERITY_WARN, "org.jboss.seam.NoConversation", "No conversation" );
I will try and see why I am not seeing that message.
L