Geronimo
  1. Geronimo
  2. GERONIMO-2584

Hot deploy module/server restart, throws IllegalArgumentException if application deployed using hotdeployment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.1.2, 1.2, 2.0-M1
    • Component/s: Hot Deploy Dir
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      Windows XP, but should be valid for all platforms

    • Patch Info:
      Patch Available

      Description

      This is a problem similar to one reported in https://issues.apache.org/jira/browse/GERONIMO-2402, the server restart or hot-deploy module restart fails with followng error if in a previous run you deployed an application using hot deployment.

      The exception trace is :
      00:54:43,008 ERROR [DirectoryMonitor] Unable to scan file C:\geronimo\geronimobu
      ild\geronimo-tomcat-j2ee-1.2-SNAPSHOT\deploy\sampleHello during initialization
      java.lang.IllegalArgumentException: Invalid id: sampleHello
      at org.apache.geronimo.kernel.repository.Artifact.create(Artifact.java:4
      9)
      at org.apache.geronimo.deployment.hot.DirectoryHotDeployer.getDeployment
      Time(DirectoryHotDeployer.java:216)
      at org.apache.geronimo.deployment.hot.DirectoryMonitor.initialize(Direct
      oryMonitor.java:233)
      at org.apache.geronimo.deployment.hot.DirectoryMonitor.run(DirectoryMoni
      tor.java:206)
      at java.lang.Thread.run(Thread.java:534)
      00:54:47,014 INFO [DirectoryHotDeployer] Deploying sampleHello
      00:54:51,350 WARN [TomcatModuleBuilder] Web application . does not contain a WE
      B-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depen
      ding on whether you have things like resource references that need to be resolve
      d. You can also give the deployer a separate deployment plan file on the comman
      d line.
      00:54:51,841 ERROR [GBeanInstance] Problem in doFail of default/sampleHello/1163
      964291070/war?J2EEApplication=null,j2eeType=WebModule,name=default/sampleHello/1
      163964291070/war
      java.lang.RuntimeException: java.lang.NullPointerException
      at org.apache.geronimo.tomcat.TomcatContainer.removeContext(TomcatContai
      ner.java:339)
      at org.apache.geronimo.tomcat.TomcatContainer$$FastClassByCGLIB$$9370b07
      3.invoke(<generated>)

      ... 31 more
      00:54:51,841 ERROR [GBeanInstanceState] Error while starting; GBean is now in th
      e FAILED state: abstractName="default/sampleHello/1163964291070/war?J2EEApplicat
      ion=null,j2eeType=WebModule,name=default/sampleHello/1163964291070/war"
      java.lang.IllegalArgumentException: addChild: Child name '/sampleHello' is not
      unique
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
      .java:749)

      Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuratio
      n default/sampleHello/1163964291070/war failed to start due to the following rea
      sons:
      The service J2EEApplication=null,j2eeType=WebModule,name=default/sampleHello/1
      163964291070/war did not start because the doStart method threw an exception.
      java.lang.IllegalArgumentException: addChild: Child name '/sampleHello' is not
      unique
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
      .java:749)

      Steps to recreate:
      1. Start server
      2. Deploy sample application, by placing sampleApp folder in deploy directory
      3. Application will be deployed and runs fine.
      4. Restart server, or restart hot-deploy module
      5. The above mentioned exception is thrown.

        Issue Links

          Activity

          Gavin made changes -
          Link This issue depends upon GERONIMO-2402 [ GERONIMO-2402 ]
          Gavin made changes -
          Link This issue depends on GERONIMO-2402 [ GERONIMO-2402 ]
          Vamsavardhana Reddy made changes -
          Fix Version/s 1.1.2 [ 12312026 ]
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 2.0-M1 [ 12312216 ]
          Fix Version/s 2.0 [ 12312152 ]
          Hide
          Vamsavardhana Reddy added a comment -

          Verified the patch on branches\1.1, branches\1.2 and trunk.

          Fixed in rev 483678.

          Show
          Vamsavardhana Reddy added a comment - Verified the patch on branches\1.1, branches\1.2 and trunk. Fixed in rev 483678.
          vamsic007 committed 483678 (6 files)
          Reviews: none

          GERONIMO-2584 Hot deploy module/server restart, throws IllegalArgumentException if application deployed using hotdeployment
            o Integrated the patch provided by Rakesh Midha
            o Patch adds getModuleId in DirectoryHotDeployer, and change calculateModuleId to use it, also defination of getModuleId is added in listener interface. Changed calculateModuleId() to use newly added method getModuleId() from DirectoryHotDeployer. This newly added method returns configId of deployed application.

          Vamsavardhana Reddy made changes -
          Assignee Vamsavardhana Reddy [ vamsic ]
          Vamsavardhana Reddy made changes -
          Fix Version/s 2.0 [ 12312152 ]
          Hide
          Vamsavardhana Reddy added a comment -

          I have tried the patch on branches\1.1 (not 1.2) in combination with the fix for GERONIMO-2402. Verified that the fix works fine and no exceptions are thrown at startup.

          Show
          Vamsavardhana Reddy added a comment - I have tried the patch on branches\1.1 (not 1.2) in combination with the fix for GERONIMO-2402 . Verified that the fix works fine and no exceptions are thrown at startup.
          Rakesh Midha made changes -
          Link This issue is duplicated by GERONIMO-1982 [ GERONIMO-1982 ]
          Rakesh Midha made changes -
          Link This issue blocks GERONIMO-1431 [ GERONIMO-1431 ]
          Rakesh Midha made changes -
          Assignee Rakesh Midha [ rakesh ]
          Patch Info [Patch Available]
          Description
          This is a problem similar to one reported in https://issues.apache.org/jira/browse/GERONIMO-2402, the server restart or hot-deploy module restart fails with followng error if in a previous run you deployed an application using hot deployment.

          The exception trace is :
          00:54:43,008 ERROR [DirectoryMonitor] Unable to scan file C:\geronimo\geronimobu
          ild\geronimo-tomcat-j2ee-1.2-SNAPSHOT\deploy\sampleHello during initialization
          java.lang.IllegalArgumentException: Invalid id: sampleHello
                  at org.apache.geronimo.kernel.repository.Artifact.create(Artifact.java:4
          9)
                  at org.apache.geronimo.deployment.hot.DirectoryHotDeployer.getDeployment
          Time(DirectoryHotDeployer.java:216)
                  at org.apache.geronimo.deployment.hot.DirectoryMonitor.initialize(Direct
          oryMonitor.java:233)
                  at org.apache.geronimo.deployment.hot.DirectoryMonitor.run(DirectoryMoni
          tor.java:206)
                  at java.lang.Thread.run(Thread.java:534)
          00:54:47,014 INFO [DirectoryHotDeployer] Deploying sampleHello
          00:54:51,350 WARN [TomcatModuleBuilder] Web application . does not contain a WE
          B-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depen
          ding on whether you have things like resource references that need to be resolve
          d. You can also give the deployer a separate deployment plan file on the comman
          d line.
          00:54:51,841 ERROR [GBeanInstance] Problem in doFail of default/sampleHello/1163
          964291070/war?J2EEApplication=null,j2eeType=WebModule,name=default/sampleHello/1
          163964291070/war
          java.lang.RuntimeException: java.lang.NullPointerException
                  at org.apache.geronimo.tomcat.TomcatContainer.removeContext(TomcatContai
          ner.java:339)
                  at org.apache.geronimo.tomcat.TomcatContainer$$FastClassByCGLIB$$9370b07
          3.invoke(<generated>)

                  ... 31 more
          00:54:51,841 ERROR [GBeanInstanceState] Error while starting; GBean is now in th
          e FAILED state: abstractName="default/sampleHello/1163964291070/war?J2EEApplicat
          ion=null,j2eeType=WebModule,name=default/sampleHello/1163964291070/war"
          java.lang.IllegalArgumentException: addChild: Child name '/sampleHello' is not
          unique
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
          .java:749)

          Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuratio
          n default/sampleHello/1163964291070/war failed to start due to the following rea
          sons:
            The service J2EEApplication=null,j2eeType=WebModule,name=default/sampleHello/1
          163964291070/war did not start because the doStart method threw an exception.
          java.lang.IllegalArgumentException: addChild: Child name '/sampleHello' is not
          unique
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
          .java:749)


          Steps to recreate:
          1. Start server
          2. Deploy sample application, by placing sampleApp folder in deploy directory
          3. Application will be deployed and runs fine.
          4. Restart server, or restart hot-deploy module
          5. The above mentioned exception is thrown.
          This is a problem similar to one reported in https://issues.apache.org/jira/browse/GERONIMO-2402, the server restart or hot-deploy module restart fails with followng error if in a previous run you deployed an application using hot deployment.

          The exception trace is :
          00:54:43,008 ERROR [DirectoryMonitor] Unable to scan file C:\geronimo\geronimobu
          ild\geronimo-tomcat-j2ee-1.2-SNAPSHOT\deploy\sampleHello during initialization
          java.lang.IllegalArgumentException: Invalid id: sampleHello
                  at org.apache.geronimo.kernel.repository.Artifact.create(Artifact.java:4
          9)
                  at org.apache.geronimo.deployment.hot.DirectoryHotDeployer.getDeployment
          Time(DirectoryHotDeployer.java:216)
                  at org.apache.geronimo.deployment.hot.DirectoryMonitor.initialize(Direct
          oryMonitor.java:233)
                  at org.apache.geronimo.deployment.hot.DirectoryMonitor.run(DirectoryMoni
          tor.java:206)
                  at java.lang.Thread.run(Thread.java:534)
          00:54:47,014 INFO [DirectoryHotDeployer] Deploying sampleHello
          00:54:51,350 WARN [TomcatModuleBuilder] Web application . does not contain a WE
          B-INF/geronimo-web.xml deployment plan. This may or may not be a problem, depen
          ding on whether you have things like resource references that need to be resolve
          d. You can also give the deployer a separate deployment plan file on the comman
          d line.
          00:54:51,841 ERROR [GBeanInstance] Problem in doFail of default/sampleHello/1163
          964291070/war?J2EEApplication=null,j2eeType=WebModule,name=default/sampleHello/1
          163964291070/war
          java.lang.RuntimeException: java.lang.NullPointerException
                  at org.apache.geronimo.tomcat.TomcatContainer.removeContext(TomcatContai
          ner.java:339)
                  at org.apache.geronimo.tomcat.TomcatContainer$$FastClassByCGLIB$$9370b07
          3.invoke(<generated>)

                  ... 31 more
          00:54:51,841 ERROR [GBeanInstanceState] Error while starting; GBean is now in th
          e FAILED state: abstractName="default/sampleHello/1163964291070/war?J2EEApplicat
          ion=null,j2eeType=WebModule,name=default/sampleHello/1163964291070/war"
          java.lang.IllegalArgumentException: addChild: Child name '/sampleHello' is not
          unique
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
          .java:749)

          Caused by: org.apache.geronimo.gbean.InvalidConfigurationException: Configuratio
          n default/sampleHello/1163964291070/war failed to start due to the following rea
          sons:
            The service J2EEApplication=null,j2eeType=WebModule,name=default/sampleHello/1
          163964291070/war did not start because the doStart method threw an exception.
          java.lang.IllegalArgumentException: addChild: Child name '/sampleHello' is not
          unique
                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
          .java:749)


          Steps to recreate:
          1. Start server
          2. Deploy sample application, by placing sampleApp folder in deploy directory
          3. Application will be deployed and runs fine.
          4. Restart server, or restart hot-deploy module
          5. The above mentioned exception is thrown.
          Hide
          Rakesh Midha added a comment -


          Attached patch, please review and commit.

          Show
          Rakesh Midha added a comment - Attached patch, please review and commit.
          Rakesh Midha made changes -
          Attachment hotdepoystartup.patch [ 12345398 ]
          Hide
          Rakesh Midha added a comment -

          Solves startup problem in hotdeployer

          Show
          Rakesh Midha added a comment - Solves startup problem in hotdeployer
          Hide
          Rakesh Midha added a comment -

          Every time restart server is called this error occurs because the configId used to create Artifact is wrong (when configId not provided via deployment descriptor).

          To resolve this problem changed calculateModuleId() to use newly added method getModuleId() from DirectoryHotDeployer. This newly added method returns configId of deployed application.

          This patch adds getModuleId in DirectoryHotDeployer, and change calculateModuleId to use it, also defination of getModuleId is added in listener interface.

          Show
          Rakesh Midha added a comment - Every time restart server is called this error occurs because the configId used to create Artifact is wrong (when configId not provided via deployment descriptor). To resolve this problem changed calculateModuleId() to use newly added method getModuleId() from DirectoryHotDeployer. This newly added method returns configId of deployed application. This patch adds getModuleId in DirectoryHotDeployer, and change calculateModuleId to use it, also defination of getModuleId is added in listener interface.
          Rakesh Midha made changes -
          Link This issue depends on GERONIMO-2402 [ GERONIMO-2402 ]
          Rakesh Midha made changes -
          Link This issue duplicates GERONIMO-2522 [ GERONIMO-2522 ]
          Rakesh Midha made changes -
          Field Original Value New Value
          Assignee Rakesh Midha [ rakesh ]
          Rakesh Midha created issue -

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development