1 Reply Latest reply on May 22, 2006 11:45 AM by blalls asdsd

    Could not register synchronization

    blalls asdsd Novice

      I am getting an error message like :

      20:00:03,963 ERROR [STDERR] java.lang.RuntimeException: org.hibernate.TransactionException: Could not register synchronization
      20:00:03,966 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulBeanContext.remove(StatefulBeanContext.java:273)
      20:00:03,966 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.remove(AbstractPool.java:171)
      20:00:03,967 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.remove(SimpleStatefulCache.java:299)
      20:00:03,967 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:89)
      20:00:03,990 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      20:00:03,994 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
      20:00:03,994 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      20:00:03,994 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      20:00:03,995 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      20:00:03,997 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      20:00:03,997 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      20:00:03,997 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:199)
      20:00:03,998 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
      20:00:04,000 ERROR [STDERR] at $Proxy124.create(Unknown Source)
      20:00:04,001 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      20:00:04,001 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      20:00:04,001 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      20:00:04,003 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      20:00:04,003 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
      20:00:04,004 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
      20:00:04,004 ERROR [STDERR] at org.jboss.seam.Component.callComponentMethod(Component.java:1202)
      20:00:04,005 ERROR [STDERR] at org.jboss.seam.Component.callCreateMethod(Component.java:1190)
      20:00:04,006 ERROR [STDERR] at org.jboss.seam.Component.newInstance(Component.java:1179)
      20:00:04,006 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1131)
      20:00:04,007 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1114)
      20:00:04,008 ERROR [STDERR] at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
      20:00:04,008 ERROR [STDERR] at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
      20:00:04,008 ERROR [STDERR] at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:574)
      20:00:04,009 ERROR [STDERR] at org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
      20:00:04,011 ERROR [STDERR] at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:455)20:00:04,011 ERROR [STDERR] at org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty(MethodBindingImpl.java:180)
      20:00:04,012 ERROR [STDERR] at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:114)
      20:00:04,012 ERROR [STDERR] at org.jboss.seam.core.Pages.callAction(Pages.java:212)
      20:00:04,014 ERROR [STDERR] at org.jboss.seam.jsf.AbstractSeamPhaseListener.callPageActions(AbstractSeamPhaseListener.java:122)
      20:00:04,014 ERROR [STDERR] at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:98)
      


      Suddenly in my application. The method cause this exceptions works fine at the first place but after ending the conversation and reclicking the link, it gives the above error message and I got to restat jboss to get to the normal situation.
      the mothod causing the problem is :
       public String list() {
       System.out.println("listing the relationssssssssssssssssss for actv" + actvBean.getId());
       mod=-1;
       try{
       rels=entityManager.createQuery(" from ActivityRelation where succActivity =:activity")
       .setParameter("activity", actvBean)
       .getResultList();
       return "rel.list";
       }catch(Exception e) {
       facesContext.addMessage(null,
       new FacesMessage(FacesMessage.SEVERITY_ERROR,
       resourceBundle.getString("error"), ""));
       return null;
       }
      
       }
      

      and I am invoking it with :
      <s:link id="listRels" action="#{relationLogic.list}" value="#{messages.relations}" propagation="nest"/>
      

      the Create method of the bean is like:
      
       relsEnum = new ArrayList<SelectItem>();
       EnumSet<RelTypeEnum> enumSet = EnumSet.allOf(RelTypeEnum.class);
       for (Enum enumType : enumSet) {
       SelectItem selectItem = new SelectItem();
       String key = ((Resourceable) enumType).toResourceKey();
      
       selectItem.setLabel(resourceBundle.getString(key));
       selectItem.setValue("" + enumType.ordinal());
       relsEnum.add(selectItem);
       }
      


        • 1. Re: Could not register synchronization
          blalls asdsd Novice

          I am going ut of vonversation by caling:

           @End
           public String back() {
           return "actv.view";
           }
          

          and after that clicking another time on s:link gives me the error message.

          I changed the s:link to commandLink and removed the @End tag from the back method ( Now joining the previous conversation instead of nesting) and everything worked fine and the error gone.