Jetty
  1. Jetty
  2. JETTY-1326

Jetty 6.1.26: Sudden HTTP ERROR 500 accessing servlet invoked by org.mortbay.jetty.servlet.Invoker

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.5.0
    • Component/s: Servlet
    • Labels:
      None
    • Environment:
      Windows Server 2008, 32 bit JRE 1.6 Update 23
    • Number of attachments :
      0

      Description

      Our Jetty based website has numerous non-context servlets invoked by org.mortbay.jetty.servlet.Invoker (nonContextServlets = true).

      The website can run without any problems for 1 hour to many days.

      But suddenly we experience HTTP ERROR 500 on one or more web-page as the stack-trace below shows.

      I have looked at the Jetty 6.1.26 and may have found an issue in ServletHolder.hasCode:
      return _name == null ? System.identityHashCode(this) : _name.hashCode();

      If _name is null System.identityHashCode(this) is used.

      What will happen if System.identityHashCode(this) doesn't return the same value over time?
      Could that cause this error?

      HTTP ERROR 500
      Problem accessing /servlet/com.yorkref.servlets.LoginStatisticServlet. Reason:

      No such servlet: com.yorkref.servlets.homeservlet-7560790

      Caused by:
      java.lang.IllegalStateException: No such servlet: com.yorkref.servlets.homeservlet-7560790
      at org.mortbay.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1077)
      at org.mortbay.jetty.servlet.ServletHandler.setServletMappings(ServletHandler.java:1163)
      at org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping(ServletHandler.java:821)
      at org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping(ServletHandler.java:782)
      at org.mortbay.jetty.servlet.Invoker.service(Invoker.java:175)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

        Activity

        Hide
        Greg Wilkins added a comment -

        The hash code should not change, so that should not be the problem.....
        AGH! but I see a horrid circularity - the holdername is being set using the hashcode of the holder, which uses the unset name to determine the hashcode. It still should not be the problem.

        But I have cleaned the code up in trunk of jetty-6 and jetty-7. Can you build from trunk and try it again (or use a SNAPSHOT build from oss.sonatype.org).

        Show
        Greg Wilkins added a comment - The hash code should not change, so that should not be the problem..... AGH! but I see a horrid circularity - the holdername is being set using the hashcode of the holder, which uses the unset name to determine the hashcode. It still should not be the problem. But I have cleaned the code up in trunk of jetty-6 and jetty-7. Can you build from trunk and try it again (or use a SNAPSHOT build from oss.sonatype.org).
        Hide
        Greg Wilkins added a comment -

        No further feedback, so assuming cleanup worked

        Show
        Greg Wilkins added a comment - No further feedback, so assuming cleanup worked

          People

          • Assignee:
            Greg Wilkins
            Reporter:
            Per Clausen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: