[jboss-user] [JBoss Seam] - Re: how can I do optimistic locking with crud framework?

cja987 do-not-reply at jboss.com
Thu Oct 19 18:02:15 EDT 2006


I had thought there would be some funniness with a conversation-scoped component starting its own conversation, so I moved beginEdit() to its own class (better design anyway) and edited pages.xml accordingly


  | @Name("contactAction")
  | public class ContactAction {
  | 
  | 	@Logger
  | 	private Log log;
  | 	
  | 	@Begin
  | 	public String beginEdit() {
  | 		log.info("Conversation begun by beginEdit()");
  | 		return null;
  | 	}
  | }
  | 

Still no luck, same behavior.  As for a conversation, I know beginEdit() is getting called (I see the log message) but I guess no conversation is entered after all, since there's no conversationId parameter in the URL when I edit, and the debug page shows no active conversations.  I wish I knew why that was.

I do see a conversationId after I click update, which is when I should expect to see the conversation ended!  The debug page does show there's no active conversations after update, however. 

I get the traceback all the same.  Here's the whole thing: 


  | java.lang.IllegalStateException: EntityManager is closed
  |         at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java:41)
  |         at org.hibernate.ejb.AbstractEntityManagerImpl.getReference(AbstractEntityManagerImpl.java:137)
  |         at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.entityIdsToRefs(ManagedEntityIdentityInterceptor.java:156)
  |         at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:76)
  |         at sun.reflect.GeneratedMethodAccessor230.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
  |         at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:30)
  |         at sun.reflect.GeneratedMethodAccessor224.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:60)
  |         at sun.reflect.GeneratedMethodAccessor223.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:50)
  |         at sun.reflect.GeneratedMethodAccessor222.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.TransactionInterceptor$1.work(TransactionInterceptor.java:26)
  |         at org.jboss.seam.util.Work.workInTransaction(Work.java:31)
  |         at org.jboss.seam.interceptors.TransactionInterceptor.doInTransactionIfNecessary(TransactionInterceptor.java:20)
  |         at sun.reflect.GeneratedMethodAccessor221.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.ConversationalInterceptor.checkConversationForConversationalBean(ConversationalInterceptor.java:81)
  |         at sun.reflect.GeneratedMethodAccessor220.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.EventInterceptor.aroundInvoke(EventInterceptor.java:51)
  |         at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:40)
  |         at sun.reflect.GeneratedMethodAccessor218.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:45)
  |         at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.interceptors.AsynchronousInterceptor.invokeAsynchronouslyIfNecessary(AsynchronousInterceptor.java:32)
  |         at sun.reflect.GeneratedMethodAccessor216.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:589)
  |         at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
  |         at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
  |         at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
  |         at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:168)
  |         at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:141)
  |         at org.jboss.seam.intercept.RootInterceptor.aroundInvoke(RootInterceptor.java:128)
  |         at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:103)
  |         at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:69)
  |         at org.jboss.seam.example.crud.ContactHome$$EnhancerByCGLIB$$6e1de699.clearDirty(<generated>)
  |         at org.jboss.seam.contexts.Lifecycle.isAttributeDirty(Lifecycle.java:467)
  |         at org.jboss.seam.contexts.ServerConversationContext.flush(ServerConversationContext.java:179)
  |         at org.jboss.seam.contexts.Lifecycle.flushAndDestroyContexts(Lifecycle.java:356)
  |         at org.jboss.seam.contexts.Lifecycle.endRequest(Lifecycle.java:259)
  |         at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:100)
  |         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:33)
  |         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.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:619)
  | 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979499#3979499

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3979499



More information about the jboss-user mailing list