users@glassfish.java.net

Re: Glassfish application protection

From: Witold Szczerba <pljosh.mail_at_gmail.com>
Date: Wed, 9 Jun 2010 01:32:17 +0200

2010/6/8 <glassfish_at_javadesktop.org>:
> Hi there.  I'm pretty new to the Glassfish scene and to J2E on the whole.  In general what's the best way to configure Glassfish so that if your hosting multiple applications on a single server and one of those apps should start causing problems that single application doesn't cause the whole server to fail - a kind of walled / ring-fenced approach.
>
> I know GF v2 has it's own HA instance / cluster but that's slightly different to what I'm thinking.  I suppose in an HA / cluster environment your only protecting against hardware failure - this doesn't stop badly written applications from failing!
>
> Many thanks
> [Message sent by forum member 'peterl001']
>
> http://forums.java.net/jive/thread.jspa?messageID=473281
>

As far as I know - it is not desirable to have more than one
independent application deployed in one instance/domain in Glassfish
(and any other JEE server). The lowest level problem is that all those
applications would share a single virtual machine instance. If one
application goes crazy and, for example, make the JVM run out of
memory - all other applications will die as well. Once any application
call System.exit(0) - all the others are gone. Once any application do
something stupid like bytecode manipulation of some server specific
class - all the other applications are in troubles.
You could try to fight this using maybe Java Security, but... well.
That would be much better to put separate applications on separate
instances.