8 Replies Latest reply on Aug 13, 2008 12:03 AM by Pete Muir

    transaction:no-transaction

    Francisco Jose Peredo Noguez Master

      I am trying to build the simplest possible Seam project that I can, I just want a WAR, over Tomcat, with just Seam 2.0.2SP1, no Hibernate (I love it but do not need it for this project). So I commented out this lines:


       <!-- persistence:managed-persistence-context name="entityManager"
                                           auto-create="true"
                                entity-manager-factory="#{MinimalSeamWebEntityManagerFactory}"/>
      
         <persistence:entity-manager-factory name="MinimalSeamWebEntityManagerFactory" 
                            persistence-unit-name="MinimalSeamWeb"/-->
      



      and disabled transaction management:


       <transaction:no-transaction/>
      



      and now I am getting this infinite loop of stack traces (for this kind of cases it would be nice to have a stop application without stopping app server button) :


      ERROR SeamPhaseListener:120 - uncaught exception
      java.lang.IllegalStateException: Could not start transaction
           at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:592)
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:323)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:140)
           at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
           at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.UnsupportedOperationException: no transaction
           at org.jboss.seam.transaction.NoTransaction.begin(NoTransaction.java:36)
           at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:587)
           ... 37 more
      11:11:07,671 ERROR SeamPhaseListener:127 - swallowing exception
      
      



      What is wrong? why it doesn't work? Something seems to be calling this method (in org.jboss.seam.transaction.NoTransaction):


      public void begin() throws NotSupportedException, SystemException
         {
            throw new UnsupportedOperationException("no transaction");
         }
      



      Shouldn't it just do nothing, why does it throw this exception? and, if it needs to throw it.. then why does Seam crash? I thought org.jboss.seam.transaction.NoTransaction was for disabling Seam-managed transactions... is it not?


      Regards,