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

    Profileservice/DeploymentManager doesn't work with JBossTools

    Juergen Zimmermann Master

      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