Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1913

host-tomcat fails to find servlet if it is added, removed and then added again.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java-SCA-1.0
    • Java-SCA-1.1
    • None
    • None

    Description

      Extending the Tomcat unit test with the following

      public void testRegisterUnregisterMapping() throws Exception {
      TomcatServer service = new TomcatServer(workScheduler);
      TestServlet servlet = new TestServlet();
      service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);

      { Socket client = new Socket("127.0.0.1", HTTP_PORT); OutputStream os = client.getOutputStream(); os.write(REQUEST1.getBytes()); os.flush(); read(client); }
      assertTrue(servlet.invoked);
      service.removeServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo");
      { Socket client = new Socket("127.0.0.1", HTTP_PORT); OutputStream os = client.getOutputStream(); os.write(REQUEST1.getBytes()); os.flush(); read(client); }

      servlet = new TestServlet();
      service.addServletMapping("http://127.0.0.1:" + HTTP_PORT + "/foo", servlet);

      { Socket client = new Socket("127.0.0.1", HTTP_PORT); OutputStream os = client.getOutputStream(); os.write(REQUEST1.getBytes()); os.flush(); read(client); }

      assertTrue(servlet.invoked);
      service.stop();
      }

      Leads to

      INFO: Added Servlet mapping: http://L3AW203:8085/foo
      19-Nov-2007 14:37:20 org.apache.tuscany.sca.http.tomcat.TomcatServer removeServletMapping
      INFO: Remove Servlet mapping: /foo
      19-Nov-2007 14:37:31 org.apache.catalina.core.StandardWrapperValve invoke
      INFO: Servlet /foo is currently unavailable
      19-Nov-2007 14:37:40 org.apache.tuscany.sca.http.tomcat.TomcatServer addServletMapping
      INFO: Added Servlet mapping: http://L3AW203:8085/foo
      19-Nov-2007 14:37:49 org.apache.catalina.core.StandardWrapperValve invoke
      INFO: Servlet /foo is currently unavailable

      Attachments

        Activity

          People

            simonslaws Simon Laws
            simonslaws Simon Laws
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: