[JBoss Seam] - Re: Can I end a conversation programmatically?
by raffaele.camanzo
Hi Gavin,
creating a specific test case it's been useful to better understand the Seam behaviour when I try to create a conversation with a given id or remove a conversation and switch to a different one. Ok, this is what I've seen:
1 - Conversation creation with a given ID: If I create a conversation with a given id (@Begin(join=true, id="myId1")), Seam creates a conversation with the given identifier, but if I have two (but I think also more than two) defined as follows:
|
| ActionOne.java:
|
| @Name("actionOne")
| @Scope(ScopeType.CONVERSATION)
| public class ActionOne {
|
| @Begin(join=true, id="actionone")
| public String startConversation() {
| .....
| return "one";
| }
| }
|
|
|
| ActionTwo.java:
|
| @Name("actionTwo")
| @Scope(ScopeType.CONVERSATION)
| public class ActionTwo {
|
| @Begin(join=true, id="actiontwo")
| public String startConversation() {
| .....
| return "two";
| }
| }
|
|
When I start the first conversation, say actionone, everything is ok, the conversation has the given identifier; but when I start the second one the conversation identifier is the same for both: the first one 'actionone', even if the two actions maintain different view ids.
If I pass the conversation identifier as a <f:param> and the param name is other than "conversationId" the conversation identifier is ignored.
If I pass a parameter named as conversationId in a <s:link> to start a conversation with a static identifier defined in the @Begin annotation the identifier is completely ignored and the conversation gets the value of the conversationId parameter.
As a recap:
I can create, correctly, only named conversations following these guidelines:
- The link to the conversation begin method must contain a parameter named conversationId, for example:
| <s:link action="#{actionTwo.startConversation}">
| <h:outputText value="Start Conversation" />
| <f:param name="conversationId" value="<something static or EL>" />
| </s:link>
|
- The conversation begin method must be defined as follows:
| @Name("actionOne")
| @Scope(ScopeType.CONVERSATION)
| public class ActionOne {
|
| @Begin(join=true, id="#{param.conversationId}")
| public String startConversation() {
| .....
| return "one";
| }
| }
|
Maybe I discovered the hot water... But I did not find all these rules to follow in the documentation, but probably I did not read very well the documentation; so if there's someone else like me... maybe he can loose less time than me to get the right way.
2 - Remove a conversation and switch to a different one: Conversation.instance().end() works (but does not execute the @End method), removes the current conversation, but does not do enough, indeed, in my application I need to switch to a different conversation in order to show the tab content of the tab which reaches the focus after the tab remotion, then I need to do this (or something equivalent):
| Conversation.instance().end();
| Manager.instance().switchConversation(focusedTabConversationId);
|
but this unfortunately does not work (as I would) and, more precisely, happens:
- if I call only the Conversation.instance().end() Seam does not switch to the conversation of the tab which reaches the focus and then does not show the correct data, moreover, in my situation the outcome of the tab removed and of the tab focused can be the same (and in my tests were the same) with the effect that the screen is frozen with the data I just removed;
- if I call both the methods Seam performs the conversation switch correctly and shows the correct tab but does not perform any conversation remotion
an example of my scenario: I have a search tab, a user can search for something, when finds what he needs selecting the related link opens a new tab with the detail and then closes the search tab, if he needs to open again the search tab is to search something else but everything he made before is already on the screen.
So, this is what I found... But I need a little of help to understand if I made something wrong, if it's a known behaviour a bug.....
Regards,
Raffaele Camanzo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025128#4025128
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025128
19Â years, 1Â month
[JBoss Seam] - Exadel, JBoss and Seam
by gavin.kingï¼ jboss.com
For those who have not yet seen the announcement here:
http://www.theserverside.com/news/thread.tss?thread_id=44506
Let me give a quick summary of what is happening, and what it means for Seam users:
* The Exadel RichFaces JSF component suite, and the Exadel Studio Pro eclipse plugin suite are being released into open source as "JBoss RichFaces" and "Red Hat Developer Studio" under LGPL and GPL licenses respectively. Ajax4JSF, which was already open source, will also be hosted at JBoss.
* The existing team at Exadel will continue to develop RichFaces, RHDS and Ajax4JSF.
* Existing functionality in JBoss IDE will be integrated with Exadel Studio Pro and maintained by the existing JBoss IDE team.
* Future development of the combined toolset will emphasize support for Seam and also Hibernate. The goal here is to build a deeply integrated and insanely productive development environment that is comparable to Microsoft's .Net.
* Existing JSF components in Seam will be migrated to the Ajax4JSF CDK (component development kit).
* Since a vibrant JSF ecosystem is of absolutely critical importance to Seam, we will continue to work with the development teams of other component suites (icefaces, trinidad, woodstock, etc) to ensure that Seam and the JSF tooling works well with these products. IMO, there will never be a single dominant vendor in this space, since UI is such a personal thing. We will also be working to make it easier to use different component suites together. For example, Trinidad and RichFaces can already co-exist, but we've got some ideas for making the experience of using them together even better.
* Exadel and JBoss hope to make a big contribution to the next revision of JSF, slated for Java EE 6.
I would like to welcome the Exadel folks to the Seam community!
In case you havn't noticed, this is the best thing that has ever happened to Seam, and is going to take us to the next level on productivity. I've personally dreamed of an opportunity to lead an effort like this for a Long Time :-)
[/url]
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025121#4025121
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025121
19Â years, 1Â month
[JBoss Seam] - seam-gen generate entities problem
by sstrenn
I am trying out seam 1.2 and jboss 4.0.5 ejb. I setup a project with seam-gen that accesses a simple little mysql database with users and blogs. After I call seam generate-entities, and restart seam, I get the following error trace upon accessing the users page.
In the example below, it appears that the User object "is not mapped", even though it has been generated by seam-gen. Same goes for my other domain objects.
Any ideas as to what is wrong? BTW - same thing happens w/postgresql.
08:05:54,875 ERROR [STDERR] Feb 15, 2007 8:05:54 AM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/UserList.xhtml]
javax.faces.el.EvaluationException: /UserList.xhtml @57,57 rendered="#{empty userList.resultList}": Exception getting value of property resultList of base of type : blogtest.UserList$$EnhancerByCGLIB$$ef8d664f
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:241)
at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
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:29)
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:43)
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:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
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(Unknown Source)
Caused by: javax.faces.el.EvaluationException: Bean: blogtest.UserList$$EnhancerByCGLIB$$ef8d664f, property: resultList
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:442)
at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
at com.sun.el.parser.AstValue.getValue(AstValue.java:117)
at com.sun.el.parser.AstEmpty.getValue(AstEmpty.java:49)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
... 32 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:438)
... 39 more
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select user from User user]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:634)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:95)
at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:104)
at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:40)
at org.jboss.seam.framework.EntityQuery$$FastClassByCGLIB$$225925e6.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
at sun.reflect.GeneratedMethodAccessor105.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:28)
at org.jboss.seam.util.Work.workInTransaction(Work.java:37)
at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:23)
at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
08:05:54,875 ERROR [STDERR]
at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:145)
at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:80)
at blogtest.UserList$$EnhancerByCGLIB$$ef8d664f.getResultList()
... 44 more
Caused by: org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [select user from User user]
at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:158)
at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:87)
at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:70)
at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:265)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3056)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2945)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at org.hi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4025119#4025119
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025119
19Â years, 1Â month