dev@glassfish.java.net

Re: Running glassfish with upstart

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Tue, 07 Feb 2012 11:28:01 -0600

On 2/7/2012 10:46 AM, Sahoo wrote:
> Tom,
>
> Do you know any code in GlassFish that assumes user.dir to be
> domain_dir/config?
No, and there shouldn't be any such code. However, this is visible to
the application if running without the security manager.
> Since we *want* GlassFish to be embeddable, we should fix such such
> code if any. I am not worried about those JVM memory settings as user
> can always pass them while invoking java command explicitly.
>
> Vince,
>
> The bootstrapping done by start-domain command is not very different
> from what happens in "java -jar glassfish.jar."
Note that there are functions that start-domain does that "java -jar"
doesn't, such as prompting for an admin password if it is set to reset.
A java -jar in that case will just not start the server.

Another difference has to do with instance or DAS restart. If using java
-jar, the restart command doesn't know what options were passed in to
the server, so it will use defaults. If started with start-domain or
start-local-instance, the instance will be restarted with the same
options that were used to start it.

Tom

>
> Sahoo
>
> On Tuesday 07 February 2012 09:37 PM, Tom Mueller wrote:
>> There are subtle differences between the two.
>>
>> With asadmin start-domain, the "user.dir" property is always the
>> config directory of the domain. With java -jar, it is the cwd at the
>> time java was run.
>>
>> With asadmin start-domain, you get the JVM flags from the domain.xml,
>> e.g.: -XX:MaxPermSize=192m, -XX:NewRatio=2, etc.
>> WIth java -jar, you don't get any of this (except for the -D JVM
>> options that are in domain.xml).
>>
>> To see the differences, start the DAS both ways and run jinfo on the
>> process.
>>
>> Tom
>>
>>
>>
>>
>> On 2/7/2012 9:48 AM, Vince Kraemer wrote:
>>> Hmm. OK.
>>>
>>> I just have to wonder why the process started by 'asadmin
>>> start-domain' doesn't leverage this simplicity....
>>>
>>> vbk
>>>
>>> On 2/7/12 7:06 AM, Sahoo wrote:
>>>> java -jar glassfish/modules/glassfish.jar should be sufficient to
>>>> start glassfish. Let me put it this way, I have not seen it not
>>>> working.
>>>>
>>>> Thanks,
>>>> Sahoo
>>>>
>>>
>