1 Reply Latest reply on Mar 11, 2006 4:19 AM by Gavin King

    @ApplicationException generates javax.transaction.NotSupport

    Per Wiklander Newbie

      Hi, I don't know if this is the correct forum or if I should should post in EJB3, but this is my problem:

      I submit to #{login.login} from a form. login is a stateless seam component. The method named login calls an other method on a stateful bean in the SESSION scope. That method looks like this:

      SessionManagerBean.java
      
      @Stateful
      @Scope(SESSION)
      @Intercept(NEVER)
      @Name("sessionManager")
      public class SessionManagerBean extends BaseBean implements SessionManager, Serializable
      {
      ...
       public String startAuthenticatedSession(String username, String password, String ip, boolean useAutologin)
       throws UnknownUserException, IncorrectPasswordException
       {
      ...
      


      And these are the exceptions it throws
      UnknownUserException.java
      
      @ApplicationException(rollback = true)
      public class UnknownUserException extends Exception
      {
       private static final long serialVersionUID = 3502720135200940182L;
      }
      


      IncorrectPasswordException.java
      
      @ApplicationException(rollback = true)
      public class IncorrectPasswordException extends Exception
      {
       private static final long serialVersionUID = 3502720135200940182L;
      }
      


      Removing the @ApplicationException anotation from both exceptions stops the following from happening, but why does it happen? I have a strong feeling that noting went wrong a couple of days ago (always trying to use latest CVS)

      I think the interresting part is
      Caused by: javax.transaction.NotSupportedException: Transaction already active, cannot nest transactions.
      

      19:40:36,041 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
      javax.servlet.ServletException: Could not start transaction
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
       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.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:44)
       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.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23)
       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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
       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:868)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
       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)
      19:40:36,042 INFO [SeamExceptionFilter] killing transaction
      19:40:36,044 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      java.lang.IllegalStateException: Could not start transaction
       at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.begin(SeamExtendedManagedPersistencePhaseListener.java:67)
       at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.beforePhase(SeamExtendedManagedPersistencePhaseListener.java:33)
       at org.apache.myfaces.lifecycle.LifecycleImpl.informPhaseListenersBefore(LifecycleImpl.java:520)
       at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:105)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
       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.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:44)
       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.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:23)
       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.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
       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:868)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
       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.transaction.NotSupportedException: Transaction already active, cannot nest transactions.
       at org.jboss.tm.TxManager.begin(TxManager.java:208)
       at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:124)
       at org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.begin(SeamExtendedManagedPersistencePhaseListener.java:61)
       ... 30 more