You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by sddoubt2 <sd...@gmail.com> on 2010/02/26 08:26:31 UTC

Start the server programmatically by using Java API

Hi All,

I am new to geronimo. I want to know how we can start/stop the server via a
Java API call.
For eg : To deploy a module on the server we can extend DeployerCLI and pass
the arguments as options,command and arguments to the command.

Class Test extends DeployerCLI {

int status = new
Test("--username","a"..."deploy","war-file-location").executeMain();

}

Similarly, what class should be extended to start/stop the server and what
arguments should be passed to it?
Should DaemonCLI class be used? It will be helpful if someone can provide a
sample code to show how this can be done.

Thanks a lot for your help!!
-- 
View this message in context: http://n3.nabble.com/Start-the-server-programmatically-by-using-Java-API-tp416760p416760.html
Sent from the Users mailing list archive at Nabble.com.

Re: Start the server programmatically by using Java API

Posted by Jack Cai <gr...@gmail.com>.
The options should be used to start your application (which will then call
DaemonCLI to start Geronimo). Also add to your classpath with the jars
listed in MANIFEST.MF of the bin/server.jar. The args for DaemonCLI.main()
should be just -

String args[] = {“--long"}

-Jack

On Sat, Feb 27, 2010 at 6:44 PM, sddoubt2 <sd...@gmail.com> wrote:

>
> Hi Jack,
> Thanks for your response.
> I  tried running geronimo run by setting GERONIMO_BATCH_ECHO=on
> I got the options as javaagent (jpa.jar) -Djava.endorsed.dirs,
> -Djava.ext.dirs, -Dorg.apache.geronimo.home.dir, -Djava.io.tmpdir, -jar
> executing -jar server.jar
>
> So should these be the arguments of the executeMain method of the DaemonCLI
> class?
> Something like
>
> String args[] = {option value, "-jar","server.jar"}
>
> Is this the right way? Do we need to specify all the options and the
> location of the jars/directories in the path?
> Thanks for ur help !!
> --
> View this message in context:
> http://n3.nabble.com/Start-the-server-programmatically-by-using-Java-API-tp416760p418981.html
> Sent from the Users mailing list archive at Nabble.com.
>

Re: Start the server programmatically by using Java API

Posted by sddoubt2 <sd...@gmail.com>.
Hi Jack,
Thanks for your response.
I  tried running geronimo run by setting GERONIMO_BATCH_ECHO=on 
I got the options as javaagent (jpa.jar) -Djava.endorsed.dirs,
-Djava.ext.dirs, -Dorg.apache.geronimo.home.dir, -Djava.io.tmpdir, -jar 
executing -jar server.jar

So should these be the arguments of the executeMain method of the DaemonCLI
class?
Something like

String args[] = {option value, "-jar","server.jar"}

Is this the right way? Do we need to specify all the options and the
location of the jars/directories in the path?
Thanks for ur help !!
-- 
View this message in context: http://n3.nabble.com/Start-the-server-programmatically-by-using-Java-API-tp416760p418981.html
Sent from the Users mailing list archive at Nabble.com.

Re: Start the server programmatically by using Java API

Posted by Jack Cai <gr...@gmail.com>.
If you look into the MANIFEST.MF in the bin/server.jar file, you'll see the
main entrance is org.apache.geronimo.cli.daemon.DaemonCLI. To understand the
arguments that need to be passed in, set GERONIMO_BATCH_ECHO=on in Windows,
then issue "geronimo run" to see the command line arguments that are used.

-Jack

On Fri, Feb 26, 2010 at 3:26 PM, sddoubt2 <sd...@gmail.com> wrote:

>
> Hi All,
>
> I am new to geronimo. I want to know how we can start/stop the server via a
> Java API call.
> For eg : To deploy a module on the server we can extend DeployerCLI and
> pass
> the arguments as options,command and arguments to the command.
>
> Class Test extends DeployerCLI {
>
> int status = new
> Test("--username","a"..."deploy","war-file-location").executeMain();
>
> }
>
> Similarly, what class should be extended to start/stop the server and what
> arguments should be passed to it?
> Should DaemonCLI class be used? It will be helpful if someone can provide a
> sample code to show how this can be done.
>
> Thanks a lot for your help!!
> --
> View this message in context:
> http://n3.nabble.com/Start-the-server-programmatically-by-using-Java-API-tp416760p416760.html
> Sent from the Users mailing list archive at Nabble.com.
>