Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: SVN trunk
    • Fix Version/s: SVN trunk
    • Component/s: framework
    • Labels:
    • Environment:

      Ubuntu

      Description

      I see Tomcat 7 give me a confusing about adding multiple aliases (virtual hosts) to a webapp. I am not sure if it a bug of Tomcat 7 because it cannot work if I add multiple virtual hosts to a webapp. It works for only the top (first) virtual host. For example:

      <webapp name="ecommerce"
      title="eCommerce"
      server="default-server"
      location="webapp/ecommerce"
      mount-point="/ecommerce"
      app-bar-display="false">
      <virtual-host host-name="localhost1"/>
      <virtual-host host-name="localhost2"/>
      </webapp>

      It will work only localhost1, localhost2 will not work. This is a log I got:

      Nov 18, 2011 5:45:32 PM org.apache.coyote.http11.AbstractHttp11Processor process
      SEVERE: Error processing request
      java.lang.ClassCastException: org.apache.tomcat.util.http.mapper.Mapper$Host cannot be cast to org.apache.catalina.Host
      at org.apache.catalina.connector.Request.getHost(Request.java:631)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:105)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)

      Any idea?

      Regards,
      Chatree Srichart

        Activity

        Hide
        Jacques Le Roux added a comment -

        I guess we should close

        Show
        Jacques Le Roux added a comment - I guess we should close
        Hide
        Hans Bakker added a comment -

        THank you chatree for the contribution

        committed revision 1204920

        Show
        Hans Bakker added a comment - THank you chatree for the contribution committed revision 1204920
        Hide
        Chatree Srichart added a comment - - edited

        Another option is waiting for Tomcat version 7.0.24 because this bug will be solved.

        Show
        Chatree Srichart added a comment - - edited Another option is waiting for Tomcat version 7.0.24 because this bug will be solved.
        Hide
        Chatree Srichart added a comment -

        Confirming that it is a bug of Tomcat 7. The Tomcat Dev community filed an issue:
        https://issues.apache.org/bugzilla/show_bug.cgi?id=52225

        He also gave me a solution to avoid this bug.

        I also attach a patch file to solve the problem. If there is not any objection, then please commit it to the trunk.

        Regares,
        Chatree Srichart

        Show
        Chatree Srichart added a comment - Confirming that it is a bug of Tomcat 7. The Tomcat Dev community filed an issue: https://issues.apache.org/bugzilla/show_bug.cgi?id=52225 He also gave me a solution to avoid this bug. I also attach a patch file to solve the problem. If there is not any objection, then please commit it to the trunk. Regares, Chatree Srichart

          People

          • Assignee:
            Hans Bakker
            Reporter:
            Chatree Srichart
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 4m
              4m
              Remaining:
              Remaining Estimate - 4m
              4m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development