[jboss-user] [JBoss Seam] - TransactionException: Could not register synchronization bug

sjmenden do-not-reply at jboss.com
Tue Aug 29 16:31:06 EDT 2006


I have inexplicably ran into this exception:  
java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization
 
  | 16:20:46,188 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
  | javax.faces.FacesException: Error calling action method of component with id _id0:_id57_0:_id61
  |         at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
  |         at javax.faces.component.UICommand.broadcast(UICommand.java:106)
  |         at javax.faces.component.UIData.broadcast(UIData.java:338)
  |         at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
  |         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
  |         at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
  |         at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
  |         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
  |         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  |         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:595)
  | Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{groupViewer.view}
  |         at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
  |         at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
  |         ... 25 more
  | Caused by: java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization
  |         at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:273)
  |         at org.jboss.ejb3.AbstractPool.remove(AbstractPool.java:171)
  |         at org.jboss.ejb3.cache.simple.SimpleStatefulCache.remove(SimpleStatefulCache.java:299)
  |         at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:89)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  |         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
  |         at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
  |         at $Proxy210.view(Unknown Source)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
  |         ... 26 more
  | Caused by: org.hibernate.TransactionException: Could not register synchronization
  |         at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:159)
  |         at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:59)
  |         at org.jboss.ejb3.stateful.StatefulBeanContext.closeExtendedPCs(StatefulBeanContext.java:284)
  |         at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:268)
  |         ... 44 more
  | Caused by: javax.transaction.RollbackException: Already marked for rollback TransactionImpl:XidImpl[FormatId=257, GlobalId=localhost/44, BranchQual=, localId=44]
  |         at org.jboss.tm.TransactionImpl.registerSynchronization(TransactionImpl.java:635)
  |         at org.hibernate.transaction.CMTTransaction.registerSynchronization(CMTTransaction.java:156)
  |         ... 47 more
  | 



I was on a page viewing my groups trying to click on a group which the pages.xml intercepts and calls viewGroup.view.


pages.xml:

  | <pages>
  | 	<page view-id="/viewGroup.jsp" action="#{groupViewer.view}" />
  | </pages>
  | 


GroupViewerBean.java

  | @Name("groupViewer")
  | @Stateful
  | @Scope(ScopeType.SESSION)
  | public class GroupViewerBean implements GroupViewer { 
  | 	
  | 	@RequestParameter
  | 	private Long groupId;
  | 	
  | 	private Long id;
  | 	
  | 	@Logger
  | 	private Log log;
  | 	
  | 	@PersistenceContext(type=EXTENDED)
  | 	private EntityManager em;
  | 
  | 	@Out(required=true)
  | 	Group group;
  | 	
  | 	public String view() { 
  | 		Map<String, Object> parameters = new HashMap<String, Object>();
  | 		Query query = em.createQuery("from Group where group.id = :id");
  | 		parameters.put("id", groupId);
  | 		
  | 		for (Entry <String, Object> param : parameters.entrySet()) {
  | 				query.setParameter( param.getKey(), param.getValue() );
  | 		}
  | 		group = (Group) query.getSingleResult();
  | 		return "/viewGroup.seam";
  | 	}
  | 	
  | 	@Destroy @Remove
  | 	public void destroy() {}
  | }
  | 


Any ideas what could cause this Exception?  I have other Stateful beans I'm using no problem. 

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

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



More information about the jboss-user mailing list