dev@glassfish.java.net

Re: Embeeded Glassfish

From: Amy Roh <amy.roh_at_oracle.com>
Date: Wed, 16 Mar 2011 23:08:21 -0700

Looks like it's isolated to ear deployment since I can restart embedded
glassfish and deploy war second time fine.

Amy

On 3/16/11 10:53 PM, Bhavanishankar wrote:
> 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