geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricky Ignatius <>
Subject Re: deploy and undeploy a gbean
Date Thu, 15 Jan 2009 00:25:00 GMT

I tried to do deploy/undeploy from code also.

Currently I create ant script to run command line to deploy/undeploy/etc.

  <target name="deploy">
    <echo message="Deploying ${} at instance port ${rmi.port}" />
    <java jar="bin/deployer.jar" fork="true">
      <arg value="--port"/>
      <arg value="${rmi.port}"/>
      <arg value="--user"/>
      <arg value="${user}"/>
      <arg value="--password"/>
      <arg value="${password}"/>
      <arg value="deploy"/>
      <arg value="${}.war"/>

Then I trigger that ant task from code.

	public void deployModule(String rmiPort, String moduleName, String user,
String password) {
        Map<String, String> param = new HashMap<String, String>();
    public void callAnt(String target, boolean showOutput,Map<String,
String> param){
        Project p = new Project();
        p.setUserProperty("ant.file", buildFile.getAbsolutePath());
        ProjectHelper helper = ProjectHelper.getProjectHelper();
        p.addReference("ant.projectHelper", helper);
        helper.parse(p, buildFile);

This one call gbean method directly using JMX:

gbeanObjName = new
Object [] paramsStartInstall = new Object[] {carFile, null, false, null,
String [] signatureStartInstall = new String[] {"",
"java.lang.String" , "boolean", "java.lang.String", "java.lang.String"};

returnObj = mbServerConn.invoke(gbeanObjName, "install-plugin", params,



djencks wrote:
> On Jan 14, 2009, at 3:29 PM, Ricky Ignatius wrote:
>> Hi,
>> I try to do same thing.
>> Currently I use ant to run command line, and call those ant task  
>> from java.
>> For install-plugin, I unable to do that using ant so I use JMX to call
>> plugin gbean directly.
>> It's work so far, is there any bteer way to do that?
> I'm a little bit confused about what you want.  The original request  
> was for advice on how to call some gbean methods from within the  
> geronimo vm.  We also have a lot of gshell commands that call these  
> gbean methods from another vm running gshell, and of course there are  
> lot of maven plugins that let you do this stuff.  You mention ant  
> repeatedly.... do you want some way to call these methods from ant?   
> Or from another vm?  JMX should certainly work but you should be able  
> to write some simpler client code if you use gbean proxies as the  
> gshell code does.
> Ant tasks should be pretty easy to write also, I think no one here  
> uses ant much so it hasn't been a priority.  If you would like to try  
> we can give you some advice and if you could contribute them that  
> would be great!
> thanks
> david jencks
>> Thanks,
>> Ricky
>> djencks wrote:
>>> On Aug 27, 2007, at 12:56 AM, Stefan Schulze Frielinghaus wrote:
>>>> I would like to have the functionality of the command line tool
>>>> "java -jar deployer.jar --user system --password manager
>>>> {deploy,undeploy} <tool>.jar" in a GBean. So I could programmatic
>>>> load and unload other GBeans via a GBean.

View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message