Hello,

today i switched from b19 to b21 and found what seems like a new bug.

My application is running as a servlet in Tomcat 5.5. I am using the standard
ServerServlet, which redirects to my class which is derived from Application.

When the first call is issued from my client to the server i am getting the
following stack trace:


java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        java.util.ArrayList.RangeCheck(ArrayList.java:547)
        java.util.ArrayList.get(ArrayList.java:322)
        com.noelios.restlet.http.HttpServerCall.<init>(HttpServerCall.java:66)
        com.noelios.restlet.ext.servlet.ServletCall.<init>(ServletCall.java:70)
        
com.noelios.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:119)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



The code line is:

   setServerProtocol(server.getProtocols().get(0)); // Assumes that server
connectors support only one protocol


when guarding the line with a test for 'null', everything works just fine.

  if ((server.getProtocols() != null) && 
      (server.getProtocols().size() > 0)) {
    setServerProtocol(server.getProtocols().get(0)); // Assumes that server
connectors support only one protocol
  } else {
    setServerProtocol(null);
  }


Is this a bug, or did i forgot to initialize something?


Ciao,
  Steffen

Reply via email to