5 Replies Latest reply on Aug 23, 2010 5:41 AM by yaserk

    Profileservice/DeploymentManager doesn't work with JBossTools

    juergen.zimmermann

      I'm not sure whether this is the right forum. When I try to programmatically redeploy an EAR, it's working fine as long as I'm using JMX.

       

      However, this code fragment doesn't work. Any hint is appreciated!

       

      Context ctx =

      new InitialContext();

       

      ProfileService ps = (ProfileService) ctx.lookup("ProfileService");

      ctx.close();

       

      DeploymentManager deploymentManager = ps.getDeploymentManager();

       

      DeploymentProgress redeploy =

      deploymentManager.redeploy("vfsfile:/.../.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server/deploy/hska.ear");

      redeploy.run();

       

       

      Throwable failure = redeploy.getDeploymentStatus().getFailure();

       

      if (failure != null)

       

         throw new RuntimeException(failure);

       

       

      The Stacktrace:

       

      java.lang.RuntimeException

       

       

      : java.lang.RuntimeException: org.jboss.profileservice.spi.NoSuchDeploymentException: Failed to find deployment in file: vfsfile:/C:/Users/Public/Documents/eclipse-workspace-swe2/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server/deploy/hska.ear/

      at de.hska.test.util.RedeployUtil.redeployDeploymentManager(

       

      RedeployUtil.java:168)

      at de.hska.test.util.RedeployUtil.redeploy(

       

      RedeployUtil.java:145)

      at de.hska.test.KundenverwaltungTest.init(

       

      KundenverwaltungTest.java:117)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(

       

      Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(

       

      NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(

       

      DelegatingMethodAccessorImpl.java:43)

      at java.lang.reflect.Method.invoke(

       

      Method.java:613)

      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(

       

      FrameworkMethod.java:44)

      at org.junit.internal.runners.model.ReflectiveCallable.run(

       

      ReflectiveCallable.java:15)

      at org.junit.runners.model.FrameworkMethod.invokeExplosively(

       

      FrameworkMethod.java:41)

      at org.junit.internal.runners.statements.RunBefores.evaluate(

       

      RunBefores.java:27)

      at org.junit.runners.ParentRunner.run(

       

      ParentRunner.java:236)

      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(

       

      JUnit4TestReference.java:46)

      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(

       

      TestExecution.java:38)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(

       

      RemoteTestRunner.java:467)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(

       

      RemoteTestRunner.java:683)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(

       

      RemoteTestRunner.java:390)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

       

      RemoteTestRunner.java:197)

      Caused by:

       

      java.lang.RuntimeException: org.jboss.profileservice.spi.NoSuchDeploymentException: Failed to find deployment in file: vfsfile:/C:/Users/Public/Documents/eclipse-workspace-swe2/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server/deploy/hska.ear/

      at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.invoke(

       

      StreamingDeploymentTarget.java:312)

      at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.redeploy(

       

      StreamingDeploymentTarget.java:145)

      at org.jboss.profileservice.management.client.upload.DeploymentProgressImpl.redeploy(

       

      DeploymentProgressImpl.java:367)

      at org.jboss.profileservice.management.client.upload.DeploymentProgressImpl.run(

       

      DeploymentProgressImpl.java:98)

      at de.hska.test.util.RedeployUtil.redeployDeploymentManager(

       

      RedeployUtil.java:163)

      ... 17 more

      Caused by:

       

      org.jboss.profileservice.spi.NoSuchDeploymentException: Failed to find deployment in file: vfsfile:/C:/Users/Public/Documents/eclipse-workspace-swe2/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server/deploy/hska.ear/

      at org.jboss.system.server.profileservice.repository.AbstractDeploymentRepository.getDeployment(

       

      AbstractDeploymentRepository.java:134)

      at org.jboss.profileservice.management.upload.remoting.DeployHandler.scheduleStop(

       

      DeployHandler.java:156)

      at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.stop(

       

      AbstractDeployHandler.java:338)

      at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.stop(

       

      AbstractDeployHandler.java:327)

      at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.redeploy(

       

      AbstractDeployHandler.java:378)

      at org.jboss.profileservice.management.upload.remoting.AbstractDeployHandler.invoke(

       

      AbstractDeployHandler.java:224)

      at org.jboss.remoting.ServerInvoker.invoke(

       

      ServerInvoker.java:897)

      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(

       

      ServerThread.java:768)

      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(

       

      ServerThread.java:721)

      at org.jboss.remoting.transport.socket.ServerThread.dorun(

       

      ServerThread.java:548)

      at org.jboss.remoting.transport.socket.ServerThread.run(

       

      ServerThread.java:234)

      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(

       

      MicroRemoteClientInvoker.java:213)

      at org.jboss.remoting.Client.invoke(

       

      Client.java:1917)

      at org.jboss.remoting.Client.invoke(

       

      Client.java:768)

      at org.jboss.profileservice.management.client.upload.StreamingDeploymentTarget.invoke(

       

      StreamingDeploymentTarget.java:304)

      ... 21 more

        • 1. Re: Profileservice/DeploymentManager doesn't work with JBossTools
          jaikiran

          Isn't this the same as what was discussed here http://community.jboss.org/message/8038#8038?

          • 2. Re: Profileservice/DeploymentManager doesn't work with JBossTools
            juergen.zimmermann

            Right, the issue still exists. Emanual was writing:

            "JBossTools uses a JMX facade to add deployments to ProfileService and it seems that those are not exposed to the DeploymentManager properly - so i will have to add a testcase to make sure this is handled in a better way."

             

            Now I tried the latest snapshot of JBossTools and JBossAS 6.0.0.M1 (which can be used in JBossTools via the 5.1 config option - don't get confused when the paths in the stacktrace show "JBoss_5.1_Runtime_Server").

            • 3. Re: Profileservice/DeploymentManager doesn't work with JBossTools
              jaikiran

              Juergen.Zimmermann wrote:

               

              Now I tried the latest snapshot of JBossTools and JBossAS 6.0.0.M1 (which can be used in JBossTools via the 5.1 config option - don't get confused when the paths in the stacktrace show "JBoss_5.1_Runtime_Server").

              I see. I wasn't aware that you were using AS 6.0.0.M1. Based on Emanuel's post in the other thread, i think it should have worked on this new version.

              • 4. Re: Profileservice/DeploymentManager doesn't work with JBossTools
                emuckenhuber
                As mentioned in the referenced post, currently you still need to load a specific profile when the deployment was added by JBossTools.
                 deployMgr.loadProfile(new ProfileKey("deployment-scanner-profile"));

                 

                I was hoping to be able to integrate some ongoing work on this, but it's more likely to happen after M2. So i'll remove this (annoying) usage in the current codebase for M2.

                • 5. Re: Profileservice/DeploymentManager doesn't work with JBossTools
                  yaserk

                  Hi Emanuel,

                   

                   

                  I guess there are a few threads related to Deployment Manager on this forum; and you seem to be the person taking care of this project.

                  Need to know if all the issues related to DeploymentManager have been resolved and can it be used in JBoss 5.1 in some way??

                   

                   

                  My requirement is to remotely deploy/undeploy or stop/start JBosss applications.

                  The following method is called while stopping/starting applications from admin console.

                   

                  [org.jboss.profileservice.management.upload.remoting.DeployHandler] (ResourceContainer.invoker.nonDaemon-3) Stop

                   

                  [org.jboss.profileservice.management.upload.remoting.DeployHandler] (ResourceContainer.invoker.nonDaemon-3) Begin start

                   

                  Is there a way to call the same remotely??

                   

                   

                  TIA,

                  Yaser