Geronimo
  1. Geronimo
  2. GERONIMO-3644

Adding a second TomcatContainer is resulting in IllegalArgumentException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.0.2, 2.1
    • Fix Version/s: 2.0.3, 2.1
    • Component/s: Tomcat
    • Security Level: public (Regular issues)
    • Labels:
      None

      Description

      I have added a second TomcatContainer gbean to config.xml using the following xml:

      <gbean gbeanInfo="org.apache.geronimo.tomcat.TomcatContainer" name="org.apache.geronimo.configs/tomcat6/2.0.3-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.0.3-SNAPSHOT/car,j2eeType=GBean,name=MyTomcatWebContainer">
      <attribute name="catalinaHome">var/catalina</attribute>
      <reference name="EngineGBean">
      <pattern><name>TomcatEngine</name></pattern>
      </reference>
      <reference name="ServerInfo">
      <pattern><name>ServerInfo</name></pattern>
      </reference>
      <reference name="WebManager">
      <pattern><name>TomcatWebManager</name></pattern>
      </reference>
      </gbean>

      Upon starting the server, I am getting an IllegalArgumentException. Exception is occurring since no name is set for defaultContext created around line 221 in TomcatContainer.java it is using a name which is an empty string. StackTrace is given below.

      21:51:11,359 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.configs/tomcat6/2.0.3-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.0.3-SNAPSHOT/car,j2eeType=GBean,name=MyTomcatWebContainer"
      java.lang.IllegalArgumentException: addChild: Child name '' is not unique
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:781)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
      at org.apache.geronimo.tomcat.TomcatContainer.doStart(TomcatContainer.java:232)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:996)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:539)
      at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
      at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
      at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
      at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:176)
      at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
      at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:254)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:294)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:539)
      at org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
      at org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
      at org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
      at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:176)
      at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
      at org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:254)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:294)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:553)
      at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
      at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:448)
      at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:187)
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:530)
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager$$FastClassByCGLIB$$ce77a924.invoke(<generated>)
      at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
      at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
      at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830)
      at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
      at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
      at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
      at org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$4bae0ada.startConfiguration(<generated>)
      at org.apache.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:156)
      at org.apache.geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:78)
      at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
      at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
      at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:30)
      21:51:15,015 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="org.apache.geronimo.configs/tomcat6/2.0.3-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.0.3-SNAPSHOT/car,j2eeType=GBean,name=MyTomcatWebContainer"
      java.lang.IllegalArgumentException: addChild: Child name '' is not unique
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:781)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
      at org.apache.geronimo.tomcat.TomcatContainer.doStart(TomcatContainer.java:232)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:996)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
      at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:553)
      at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
      at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:448)
      at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:187)
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:530)
      at org.apache.geronimo.kernel.config.SimpleConfigurationManager$$FastClassByCGLIB$$ce77a924.invoke(<generated>)
      at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
      at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
      at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830)
      at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
      at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
      at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
      at org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$4bae0ada.startConfiguration(<generated>)
      at org.apache.geronimo.system.main.EmbeddedDaemon.doStartup(EmbeddedDaemon.java:156)
      at org.apache.geronimo.system.main.EmbeddedDaemon.execute(EmbeddedDaemon.java:78)
      at org.apache.geronimo.kernel.util.MainConfigurationBootstrapper.main(MainConfigurationBootstrapper.java:45)
      at org.apache.geronimo.cli.AbstractCLI.executeMain(AbstractCLI.java:67)
      at org.apache.geronimo.cli.daemon.DaemonCLI.main(DaemonCLI.java:30)

        Activity

        Vamsavardhana Reddy created issue -
        Vamsavardhana Reddy made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Joe Bohn made changes -
        Affects Version/s 2.0.x [ 12312601 ]
        Fix Version/s 2.0.3 [ 12313315 ]
        Fix Version/s 2.0.x [ 12312601 ]

          People

          • Assignee:
            Vamsavardhana Reddy
            Reporter:
            Vamsavardhana Reddy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development