5 Replies Latest reply: Sep 8, 2010 11:12 AM by David K RSS

MainDeployer through JMX in JBoss 5

Abu Antar Newbie

return empty result for list of deployed applications.

jmx maindeployer is supported in jboss 5?

  • 1. Re: MainDeployer through JMX in JBoss 5
    Wolfgang Knauf Master

    Hi,

     

    though it will not really help ;-): https://jira.jboss.org/jira/browse/JBAS-5643

     

    My guess is that "listDeployed" only returns something if the app is deployed using the MainDeployer. An app deployed by copying to the deploy folder will not be returned. But I never verified this guess.

     

    Best regards

     

    Wolfgang

  • 2. Re: MainDeployer through JMX in JBoss 5
    Emanuel Muckenhuber Master

    Wolfgang Knauf wrote:

     

    My guess is that "listDeployed" only returns something if the app is deployed using the MainDeployer. An app deployed by copying to the deploy folder will not be returned. But I never verified this guess.

    Correct. The MainDeployer exposed through JMX is deprecated and only handles deployments directly deployed through it.

     

    As an alternative you could try to use the ProfileService ManagementView to list deployed applications and the ProfileService DeploymentManager in 5.x to deploy/undeploy applications.

  • 3. Re: MainDeployer through JMX in JBoss 5
    Yaser Khursheed Newbie

    Hi Emanuel,

     

    Can DeploymentManager be used to deploy/undeploy applications in Jboss 5.1?

    As per the following thread there were some issues with the old JBoss release. (http://community.jboss.org/thread/147362)

     

     

    I am getting the following exception while trying to run the sample program "DeploymentTest.java":

    javax.naming.CommunicationException

     

    [Root exception is java.lang.ClassNotFoundException: org.jboss.aspects.security.SecurityClientInterceptor (no security manager: RMI class loader disabled)]

    at org.jnp.interfaces.NamingContext.lookup(

    NamingContext.java:845)

    at org.jnp.interfaces.NamingContext.lookup(

    NamingContext.java:686)

    at javax.naming.InitialContext.lookup(Unknown Source)

    at tester.DeploymentTest.getProfileService(

    DeploymentTest.java:70)

    at tester.DeploymentTest.getDeploymentManager(

    DeploymentTest.java:63)

    at tester.DeploymentTest.deployAndUndeploy(

    DeploymentTest.java:17)

     

     

     

    Br,

    Yaser

  • 4. Re: MainDeployer through JMX in JBoss 5
    Emanuel Muckenhuber Master

    Yaser Khursheed wrote:

     

    Can DeploymentManager be used to deploy/undeploy applications in Jboss 5.1?

    As per the following thread there were some issues with the old JBoss release. (http://community.jboss.org/thread/147362)


    Yes, it can be used for deployment/undeployment of applications, however there haven't been any updates to 5.1 - so in case there are issues you should give AS6 a try. AFAIK you would need to have the following .jars as part of your client classpath:

     

    "client/jbossall-client.jar",
    "client/trove.jar",
    "client/javassist.jar",
    "common/lib/jboss-security-aspects.jar",
    "lib/jboss-managed.jar",
    "lib/jboss-metatype.jar",
    "lib/jboss-dependency.jar"

  • 5. Re: MainDeployer through JMX in JBoss 5
    David K Newbie

     

    synchronized static public void redeployProject(String _project)
    {
    System.out.println("redépoiement manuel de "+_project);
    try
    {
    InitialContext ctx = new InitialContext(); // From jndi.properties
    ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
    org.jboss.deployers.spi.management.deploy.DeploymentManager deploymentManager = ps.getDeploymentManager();
    DeploymentProgress redeploy = deploymentManager.redeploy(_project);
    redeploy.run();
    }
    catch (Exception e)
    {
    e.printStackTrace();
    System.out.println("Impossible de redéployer l'application "+_project+".");
    }
    }

    if that can help some one :

     

    synchronized static public void redeployProject(String _project)

    {

    System.out.println("redépoiement manuel de "+_project);

     

    try

    {

    InitialContext ctx = new InitialContext(); // From jndi.properties

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

    org.jboss.deployers.spi.management.deploy.DeploymentManager deploymentManager = ps.getDeploymentManager();

     

    DeploymentProgress redeploy = deploymentManager.redeploy(_project);

    redeploy.run();

    }

    catch (Exception e)

    {

    e.printStackTrace();

    System.out.println("Impossible de redéployer l'application "+_project+".");

    }

    }

     

     

    _projet = "yourproject.war"

    that's work with jboss6 and i think 5 too