5 Replies Latest reply on Aug 3, 2009 8:04 PM by Matthias Age

    Swallowing exception ?

    Matthias Age Newbie
      What does "swallowing exception" mean?
      I continue to get this error
      [18:11:46,224,SeamPhaseListener] swallowing exception

      Thx
      Matthias

      [18:11:46,224,SeamPhaseListener] swallowing exception
      java.lang.IllegalStateException: Could not start transaction
           at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:599)
           at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:584)
           at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:325)
           at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
           at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
           at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:104)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
           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.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           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:177)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           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 it.siag.filter.KerberosFilter.doFilter(KerberosFilter.java:102)
           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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           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:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.transaction.NotSupportedException
           at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:79)
           at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:77)
           at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:124)
           at org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:39)
           at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:594)
           ... 49 more
        • 1. Re: Swallowing exception ?
          Arbi Sookazian Master

          I'm not sure why the exception is not handled properly, but most likely the relevant code in SeamPhaseListener class is this:


          public void beforePhase(PhaseEvent event)
             {
                log.trace( "before phase: " + event.getPhaseId() );
                
                FacesLifecycle.setPhaseId( event.getPhaseId() );
          
                try
                {
                   if ( isPortletRequest(event) )
                   {
                      beforePortletPhase(event);
                   }
                   else
                   {
                      beforeServletPhase(event);
                   }
                   raiseEventsBeforePhase(event);
                }
                catch (Exception e)
                {
                   try
                   {
                      Exceptions.instance().handle(e);
                   }
                   catch (Exception ehe) 
                   {
                      log.error("swallowing exception", e);
                   }
                }
          
             }

          • 2. Re: Swallowing exception ?
            Ingo Jobling Master

            Hi Mattiase,


            Swallowing exception means to continue processing as if nothing had gone wrong even though an exception has been thrown.


            This is because the JSF specification explicitly forbids throwing exceptions during certain portions of the lifecycle.


            Looking at the stack trace you posted, there seems to be a problem in beginning a transaction.  Seam normally executes requests within transactions.


            Regards, Ingo

            • 3. Re: Swallowing exception ?
              Matthias Age Newbie

              But why can't Seam start a transaction in my case?
              It does it automatically for every request, I know, and normally I have no problems with this.


              But randomly it appears?

              Why? Any ideas?


              Matthias

              • 4. Re: Swallowing exception ?
                Ingo Jobling Master

                Matthias, what version of Jboss AS are your running?  Perhaps you are having this issue: JBAS-4481

                • 5. Re: Swallowing exception ?
                  Matthias Age Newbie

                  Ingo Jobling wrote on Jul 31, 2009 01:53:


                  Matthias, what version of Jboss AS are your running?  Perhaps you are having this issue: JBAS-4481



                  I'm using JBoss 4.2.3 (with jdk 6).

                  So it's not this bug, but perhaps this one JBAS-6663