Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5671

Attempting to deploy a duplicate context removes existing servlet bindings

    XMLWordPrintable

    Details

      Description

      In jboss by default there is a root Tomcat context supplied by deploy/ROOT.war
      This jsp page can be accessed using http://localhost:8080

      If you attempt to deploy another war in the same context it correctly gives an error message

      11:53:40,865 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=
      11:53:40,889 ERROR [BaseModelMBean] Exception invoking method addChild
      java.lang.IllegalArgumentException: addChild: Child name '' is not unique
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:780)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
      at org.apache.catalina.core.StandardContext.init(StandardContext.java:5384)
      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:344)
      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:139)
      at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:431)
      at org.jboss.web.deployers.WebModule.startModule(WebModule.java:112)
      at org.jboss.web.deployers.WebModule.start(WebModule.java:90)

      But it also removes the servlet bindings for the ROOT.war,

      To reproduce:

      1) Start jboss
      2) Access http://localhost:8080 - gives a jsp page
      3) In the testsuite, run ./build.sh one-test -Dtest=org.jboss.test.web.test.RootContextUnitTestCase
      4) Refresh the page (make sure to flush the web browser cache)

      If you look at Tomcat's JSR77 mbeans before and after, you'll see that the web module for localhost/ still exists,
      but the servlet bindings have disappeared.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rmaucher Remy Maucherat
                Reporter:
                adrian.brock Adrian Brock
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: