dev@glassfish.java.net

Re: Running glassfish with upstart

From: John Lister <john.lister_at_kickstone.com>
Date: Mon, 13 Feb 2012 15:12:32 +0000

On 09/02/2012 14:37, Sahoo wrote:
> On Thursday 09 February 2012 06:46 PM, John Lister wrote:
>>
>>>> Also the change in user.dir seems to be important especially if you
>>>> are using third party jars (eg database driver). Currently I have
>>>> them in the domain lib directory but just using the glassfish.jar
>>>> file doesn't seem to include this in the classpath, or at least
>>>> glassfish can't find them
>>> Not sure what you mean here. user.dir is only useful while resolving
>>> relative file URIs. They don't affect class loading.
>> I have a number of 3rd party jar files in domains/domain1/lib which
>> if I use asadmin are picked up correctly, but when using the
>> glassfish.jar directly I get ClassNotFoundExceptions. This directory
>> isn't in the classpath in either instance and I seem to remember
>> there is a custom classloader that looks in here, so I'm guessing it
>> uses the user.dir to derive the expected location of the above lib
>> directory, but I could be wrong...
> Do you have any exception stack that I can look at? I am pretty sure
> we pick up jars from domain_dir/lib/ when started via java -jar
> glassfish.jar.
Apologies for some reason the machine I was testing on had the jar files
installed in domains/domain1/lib/ext and not domains/domain1/lib.
Although i'd expect that to work as well?

> Do this:
> java -jar glassfish/modules/glassfish.jar
> Let it start and then Ctrl ^C or kill
> You should see some output like
> /Completed shutdown of GlassFish runtime/

Pressing ctrl^c / sigterm results in nothing, there is a pause and then
it terminates, but nothing is dumped to the console or the log files
(maybe a lower log level is needed?) Using asadmin results in "Server
shutdown initiated" followed by various message from things shutting
down and then finally "Shutdown procedure finished". This is the
glassfish v3.1.1 b12.

> Occasionally you shall see some exceptions as well, but they are
> harmless. The server should be robust enough to take care of any
> pending tasks during restart - if it does not, then that's a bug in
> the server. How can it expect that it would be always shutdown
> gracefully? e.g., power failure or system crash.

I guess if you have a power failure or system crash you have bigger
issues on your mind. I was trying to get a generic script and was
thinking about advanced setups with clustering for example. I didn't
know if any data needed to be flushed before it shutdown. I'll ignore it
for now

Thanks

John

-- 
Get the PriceGoblin Browser Addon
www.pricegoblin.co.uk