3 Replies Latest reply on Nov 28, 2010 5:47 PM by Tim Evers

    occasionally ---- Servlet.service() for servlet default threw exception

    Tauseef Ahmed Newbie

      Hi,


      I am getting this error in my application occasionally, i am using seam 2.2,icefaces 1.8.2



      Thanks,
      Tauseef

        • 1. Re: occasionally ---- Servlet.service() for servlet default threw exception
          Tim Evers Master

          When you want help with a problem you need to describe the problem properly.


          If you are getting an exception you must always provide the FULL stacktrace. Providing the single line of where the exception is thrown from is almost useless as we are missing the caused by clause which is really what the problem is.


          So, provide the full stacktrace. Describe when the problem happens (what are you doing to reproduce this problem). Your Server (tomcat, jboss etc).


          Think of it like this. If I came to you as a tester of your application and said. I get a NullPointerException occasionally when I'm using the app can you go fix it please. Would you be able to fix it? No. (You want to know what page I was on, what button I clicked on, what options I had chosen, what dataset I was working on, etc etc). So, when asking for help provide as much information as you possibly can. Too much information almost always better then too little.

          • 2. Re: occasionally ---- Servlet.service() for servlet default threw exception
            Tauseef Ahmed Newbie

            Sorry Tim,


            Here is the complete stack trace, i am using Jboss 5.1.0.


            java.lang.IllegalStateException
            at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435)
            at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:126)
            at org.jboss.seam.web.RedirectFilter$1.sendRedirect(RedirectFilter.java:72)
            at org.jboss.seam.mock.MockExternalContext.redirect(MockExternalContext.java:528)
            at org.jboss.seam.faces.FacesManager.redirect(FacesManager.java:220)
            at org.jboss.seam.faces.FacesManager.redirect(FacesManager.java:185)
            at org.jboss.seam.faces.Redirect.execute(Redirect.java:154)
            at org.jboss.seam.exception.DebugPageHandler.handle(DebugPageHandler.java:32)
            at org.jboss.seam.exception.Exceptions.handle(Exceptions.java:76)
            at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:114)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
            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.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
            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.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:235)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
            at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Unknown Source)

            • 3. Re: occasionally ---- Servlet.service() for servlet default threw exception
              Tim Evers Master

              When working on a problem like this it is always a good idea to get the source for the code that is throwing the exception and see why it is throwing it.


              I had a quick look at the code and the exception is thrown because something is trying to perform a redirect on a committed response.


              So, now we look further down the stack trace and we see this.


              org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:114) at
              



              So, the exception you have given here for us to solve is not the real problem. What is happening is somewhere prior to this exception another exception is being thrown. Seam is trying to handle the exception and take you to the debug page but is unable to perform the redirect because the response has been committed.


              So, what you need to do:


              Go check your logs for any exceptions that happened before this one. That is more then likely what the real problem is.


              If you are having a hard time finding it then turn off Seam's debug mode. This will ensure the failure is not handled by Seam OR Write your own ExceptionFilter and log out the exceptions you are getting to help you find the problem. Use org.jboss.seam.web.ExceptionFilter as your example.


              Download the source for every library you are using and attach it to your IDE so that when you have problems like this you can use remote debugging to step through the execution of your code and see what causes the failure.


              The only issue I see here at the moment is that the Seam debug page has a small problem dealing with whatever this problem is you are having. My guess is that once you know the real problem it will make more sense.