dev@glassfish.java.net

Re: Embeeded Glassfish

From: Bhavanishankar <bshankar_at_sun.com>
Date: Thu, 17 Mar 2011 11:23:12 +0530

It could be a bug with the deployer.

Please file an issue (http://java.net/jira/browse/GLASSFISH) and attach
your .ear file.

_Bhavani

On 03/17/2011 08:14 AM, Márcio Geovani Jasinski wrote:
> Hi,
>
> I have a question regarding Embeeded Glassfish version.
> Is there any reason to embeeded version stop a container during
> glassfish.stop() method and don't startup it again after a start?
>
> The code I'm testing is below:
>
>
> GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish();
> glassfish.start();
> Deployer deployer = glassfish.getService(Deployer.class);
> String deployedApp = deployer.deploy(new
> File("sample-ear.ear").toURI(), "--contextroot=hello",
> "--force=true"); //Works fine
> deployer.undeploy(deployedApp);
> glassfish.stop();
>
> glassfish.start();
> Deployer deployer = glassfish.getService(Deployer.class);
> String deployedApp = deployer.deploy(new
> File("sample-ear.ear").toURI(), "--contextroot=hello",
> "--force=true"); //Doesn't work (javax.ejb.EJBException: Attempt
> to invoke when container is in STOPPED)
> deployer.undeploy(deployedApp);
> glassfish.stop();
>
>
> As you can see, I'm calling start, deploy, stop and everything works fine.
> My sample-ear.ear file is nothing more than a Timer which prints
> something every second...
>
> After stop my application, I would like to restart the server
> (simulate a glassfish restart) and at this point deploy cannot complete.
> Looks like container was stopped during glassfish.stop() but didn't
> start again after glassfish.start().
>
> Is it designed to behave like that or is it a bug on embeeded version?
>
> Cheers,
> --
> Márcio Geovani Jasinski
> Blumenau, Santa Catarina
> Fone: +55 47 9653 4899

-- 
Sun, an Oracle Company