4 Replies Latest reply on Jan 4, 2007 2:18 PM by ashok_94

    Twiddle - How to undeploy a ear with twiddle

    ashok_94

      Hi,
      I am playing with twiddle and want to stop ( un-deploy) an application running in jboss.

      twiddle -s localhost:4099 unregister 'jboss:J2EEServer=Local,j2eeType=J2EEApplication,name=abcd.ear'

      But i get the following error :
      twiddle: Invalid object name: 'jboss:J2EEServer

      Unregister one or more MBeans

      usage: unregister [options] ()+

      options:
      -- Stop processing options


      Any ideas, suggestions. How should i use twiddle to undeploy an application.


      regards
      Ashok

        • 1. Re: Twiddle - How to undeploy a ear with twiddle
          peterj

          You need to place mbean names within double quotes:

          twiddle -s localhost:4099 unregister "jboss:J2EEServer=Local,j2eeType=J2EEApplication,name=abcd.ear"

          But that only gets rid of one of the MBeans related to your application, it does not necessarily undeploy the application. To do that, you really want to use the 'undeploy' method on the jboss.system:service-MainDeployer mbean. I haven't used that method, but i think that you would pass it the full path name for the ear file. For example:

          twiddle -s localhost:4099 invoke "jboss.system:service=MainDeployer" undeploy file:///opt/jboss-4.0.5.GA/server/default/deploy/adcd.ear

          • 2. Re: Twiddle - How to undeploy a ear with twiddle
            ashok_94

            thanks a ton peter.

            I used the --invoke "jboss.system:service=MainDeployer" -- and i was able to undeploy.

            then tried to deploy using the same paramters but changing the undeploy to deploy. First i got a ClassNotFoundException : twiddle: java.lang.ClassNotFoundException: org.jboss.deployment.DeploymentInfo.

            Tehn i put the jboss-system.jar into tweedle's classpath and now i get this error :
            twiddle: java.lang.RuntimeException: No property editor for type: org.jboss.deployment.DeploymentInfo

            Any idea about this ?

            regards
            Ashok

            • 3. Re: Twiddle - How to undeploy a ear with twiddle
              peterj

              That's wierd. There are three overloads to the deploy method. One takes a string, the other a URL, the last one a DeploymentInfo object. It should be attempting to use the URL variant, but it appears that it is trying to use the DeploymentInfo variant. Try again, but without the 'file://' prefix on the file name string.

              By the way, since your ear file is in the deploy directory, it might be that the hot deployer, when it wakes up, might automatically redeploy the app. (The undeploy does not delete the file.)

              When I have used the deploy method before, my app was not in the deploy directory. For example, I could deploy from /opt/javaee/myapp.ear, and then also undeploy from there.

              • 4. Re: Twiddle - How to undeploy a ear with twiddle
                ashok_94

                Hi Peter,

                i guess i suck.

                I looked up the MainDeployer MBean from jmx-console and it had separate operations for deploy, undeploy, redeploy. I tried re-deploy and it worked great.

                Thanks again for being such a great help in this matter.

                regards
                Ashok