7 Replies Latest reply on Oct 25, 2007 10:02 AM by adrian.brock

    Redeploying after an error JBAS-4900

    starksm64

      We are not properly unregistering a failed deployment as you cannot simply try to redeploy a previously failed deployment. I have seen this and Thomas as raised this issue:
      http://jira.jboss.com/jira/browse/JBAS-4900

      Can Ales or Adrian take a look at why

      This can be reproduced by running the org.jboss.test.client.test.AppClientUnitTestCase. It first fails with:

      Caused by: java.lang.IllegalStateException: jms/anotherQueue in , but not in
       at org.jboss.metadata.javaee.support.JavaEEMetaDataUtil.merge(JavaEEMetaDataUtil.java:110)
       at org.jboss.metadata.javaee.spec.ResourceEnvironmentReferencesMetaData.merge(ResourceEnvironmentReferencesMetaData.java:56)
       at org.jboss.metadata.javaee.spec.RemoteEnvironmentRefsGroupMetaData.merge(RemoteEnvironmentRefsGroupMetaData.java:391)
       at org.jboss.metadata.client.jboss.JBossClientMetaData.merge(JBossClientMetaData.java:313)
       at org.jboss.ejb3.deployers.JBossClientParsingDeployer.createMetaData(JBossClientParsingDeployer.java:63)
       at org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput.deploy(AbstractParsingDeployerWithOutput.java:162)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
       ... 63 more
      22:18:14,073 WARN [MainDeployer] Failed to deploy: file:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** DEPLOYMENTS IN ERROR: Name -> Error
      
      vfsfile:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear -> org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear/app-client.jar
      


      but subsequent redeploy attempts fail with:
      22:19:22,408 WARN [MainDeployer] Failed to deploy: file:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** DEPLOYMENTS MISSING DEPLOYERS: Name
      
      vfsfile:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear
      
      *** DEPLOYMENTS IN ERROR: Name -> Error
      
      vfsfile:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear -> java.lang.IllegalStateException: vfsfile:/home/svn/JBossHead/jboss-head/testsuite/output/lib/app-client.ear is already installed.
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:644)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:412)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:400)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:814)
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      


      The MainDeployer.redeploy should be removing the previous failed deployment if it was not already removed due to the failure, but its not.


        • 1. Re: Redeploying after an error JBAS-4900
          thomas.diesler

          This issue is not strictly a redeployment issue. It also fails for this sequence:

          * deploy foo with failure
          * undeploy foo
          * deploy foo again

          • 2. Re: Redeploying after an error JBAS-4900
            alesj

             

            "thomas.diesler@jboss.com" wrote:
            This issue is not strictly a redeployment issue. It also fails for this sequence:

            * deploy foo with failure
            * undeploy foo
            * deploy foo again

            What does it 'say' when it fails with 'deploy foo again'?

            • 3. Re: Redeploying after an error JBAS-4900
              alesj

              We already have this test - RedeployAfterErrorTestCase.

               public void testRedeployAfterError() throws Throwable
               {
               KernelDeployment deployment = deploy("RedeployAfterErrorTestCase_bad.xml");
               try
               {
               ControllerContext context = getControllerContext("Name1", null);
               assertEquals(ControllerState.ERROR, context.getState());
               checkThrowable(ClassNotFoundException.class, context.getError());
               }
               finally
               {
               undeploy(deployment);
               }
              
               validate();
              
               deployment = deploy("RedeployAfterErrorTestCase_good.xml");
               try
               {
               validate();
               assertNotNull(getBean("Name1"));
               }
               finally
               {
               undeploy(deployment);
               }
               }
              


              • 4. Re: Redeploying after an error JBAS-4900

                I'm seeing a related problem even if I deploy the inner app-client.jar
                rather than the ear (so it isn't even related to sub-deployments).

                When I undeploy the jar, it still reports it as incomplete.

                14:45:00,943 WARN [HDScanner] Failed to process changes
                org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                
                *** CONTEXTS IN ERROR: Name -> Error
                
                vfsfile:/home/ejort/jboss-head/build/output/jboss-5.0.0.Beta3/server/default/deploy/app-client.jar -> java.lang.IllegalStateException: jms/anotherQueue in , but not in
                
                
                 at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:620)
                 at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:393)
                 at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
                 at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
                 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
                 at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
                 at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
                 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                 at java.lang.Thread.run(Thread.java:595)
                


                So the test in the deployers testsuite isn't catching this situation, whatever it is.

                • 5. Re: Redeploying after an error JBAS-4900

                  The problem is caused by the DeploymentControllerContext not getting removed,
                  it is in the state of **ERROR**, but still available for the checkComplete() processing.

                  2007-10-25 15:15:58,218 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] Remove deployment context: vfsfile:/home/ejort/jboss-head/build/output/jboss-5.0.0.Be
                  ta3/server/default/deploy/app-client.jar
                  2007-10-25 15:15:58,218 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] Not scheduling removal of context already in error: vfsfile:/home/ejort/jboss-head/bu
                  ild/output/jboss-5.0.0.Beta3/server/default/deploy/app-client.jar
                  2007-10-25 15:15:58,218 DEBUG [org.jboss.deployers.plugins.main.MainDeployerImpl] Asked to process() when there is nothing to do.
                  


                  The last two lines are not true. It needs to uninstall the failed contexts from the Microcontainer.

                  I can reproduce the problem by modifying the HeuristicAllOrNothing test,
                  to validate that a failed deployment doesn't produce an IncompleteDeploymentException
                  after it is undeployed

                  [ejort@warjort deployer]$ svn diff
                  Index: test/HeuristicAllOrNothingUnitTestCase.java
                  ===================================================================
                  --- test/HeuristicAllOrNothingUnitTestCase.java (revision 66174)
                  +++ test/HeuristicAllOrNothingUnitTestCase.java (working copy)
                  @@ -154,6 +154,9 @@
                   assertEquals(expectedNothing, deployer2.getDeployedUnits());
                   assertEquals(expectedNothing, deployer2.getUndeployedUnits());
                   assertEquals(DeploymentState.ERROR, main.getDeploymentState(deployment.getName()));
                  +
                  + main.removeDeployment(deployment);
                  + main.checkComplete();
                   }
                  


                  This test is currently failing.

                  • 6. Re: Redeploying after an error JBAS-4900

                     

                    "adrian@jboss.org" wrote:

                    [ejort@warjort deployer]$ svn diff
                    Index: test/HeuristicAllOrNothingUnitTestCase.java
                    ===================================================================
                    --- test/HeuristicAllOrNothingUnitTestCase.java (revision 66174)
                    +++ test/HeuristicAllOrNothingUnitTestCase.java (working copy)
                    @@ -154,6 +154,9 @@
                     assertEquals(expectedNothing, deployer2.getDeployedUnits());
                     assertEquals(expectedNothing, deployer2.getUndeployedUnits());
                     assertEquals(DeploymentState.ERROR, main.getDeploymentState(deployment.getName()));
                    +
                    + main.removeDeployment(deployment);
                    + main.checkComplete();
                     }
                    



                    Well actually, that's missing a main.process(), but since main.process()
                    is currently wrongly doing nothing it doesn't effect the conclusion. ;-)

                    • 7. Re: Redeploying after an error JBAS-4900

                      I've fixed the problem in the Microcontainer trunk,
                      but I haven't closed the task, because I'm not sure whether it should be assigned
                      to beta5 or beta6, see the other thread?

                      MC JIRA Task
                      http://jira.jboss.com/jira/browse/JBMICROCONT-212

                      When I update the AS to beta5 and copy the deployers-impl manually into
                      the AS, I no longer see the "already installed" message when re-running the
                      appclient test.