8 Replies Latest reply on Oct 8, 2007 11:31 AM by shane.bryzak

    catching exceptions + stack trace

    damianharvey

      Should I still see the stack trace in the logs when org.jboss.seam.security.NotLoggedInException is intercepted by Seam? Or should it just redirect to the page as per the pages.xml rule (which it does) but without generating a stack trace in the logs?

      Thanks,

      Damian.

        • 1. Re: catching exceptions + stack trace
          damianharvey

          Just tried the SeamSpace example as suggested in another thread and it also dumps the stack trace to the logs when a NotLoggedInException is encountered.

          Any way to stop this? Aiming for tidy logs.

          Thanks,

          Damian.

          • 2. Re: catching exceptions + stack trace
            shane.bryzak

            How did you get it to produce the stack trace? If you could create a JIRA issue with the details and assign to me I'll take a look at this for you.

            • 3. Re: catching exceptions + stack trace
              damianharvey

              Maybe my terminology is incorrect. What I see in the logs is this:

              11:35:59,848 INFO [Lifecycle] starting up: org.jboss.seam.security.identity
              11:36:12,167 ERROR [SeamPhaseListener] uncaught exception
              org.jboss.seam.security.NotLoggedInException: Error evaluating expression [#{identity.loggedIn}] - User not logged in
               at org.jboss.seam.security.Identity.checkRestriction(Identity.java:169)
               at org.jboss.seam.pages.Page.enter(Page.java:186)
               at org.jboss.seam.core.Pages.enterPage(Pages.java:239)
               at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:242)
               at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:193)
               at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:57)
               at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
               at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:373)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
               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.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
               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.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:43)
               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.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
               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.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
               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:613)
              


              Whereas I was hoping that this would be caught and not shown in the logs.

              • 4. Re: catching exceptions + stack trace
                christian.bauer

                I also get both NotLoggedInException and AuthorizationException in the logs if I only handle them with in pages.xml. If I use the login-required="true" mechanism, at last the NotLoggedInException goes away.

                I've read somewhere that this is currently expected behavior. Not sure that's going to make people happy long term :)

                • 5. Re: catching exceptions + stack trace
                  christian.bauer

                  ... if I handle them with >exception> in pages.xhtml.

                  • 6. Re: catching exceptions + stack trace
                    gavin.king

                    Yes, currently the exception handling stuff *alway* logs the exception before swallowing it. In some cases this is probably not what you want, so I suppose we should introduce something like:

                    <exception class="MyException" log="false">
                     ...
                    </exception>


                    • 7. Re: catching exceptions + stack trace
                      mindgame

                      Have this attribute, log="false" been introduced in Seam 2.0 CR2? Or the issue has been addressed in other approach? Thanks.

                      • 8. Re: catching exceptions + stack trace
                        shane.bryzak

                        This hasn't been implemented yet, however I've created a JIRA issue for it.

                        http://jira.jboss.com/jira/browse/JBSEAM-2071