dev@glassfish.java.net

Re: preventing install/domain mismatches

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Tue, 28 Nov 2006 13:18:54 -0800

vince kraemer wrote:
> I need to prevent users from using the bits associated with one version
> of the server from starting a domain created for a different version of
> the server.
>
> Here is the method that I think will work, but it is very assumption
> heavy... Is there a better way to do this?
>
> input: a domain's "root" directory and and installation's root directory
>
> 1. get the System ID for the domain.xml document.
>
> 2. see if there is a dtd, with a name that matches the dtd named in the
> System ID of the domain.xml document, in the install-root/lib/dtds
>
> If there is a file with a matching name, I assume the domain IS
> compatible with the installation...
>
> If there isn't a matching file, or just about any other failure, I
> assume the domain IS NOT compatible with the installation...

Since every new version of the app server should support the domain.xml
from older versions, either directly or through automatic invocation of
the upgrade tool, you're largely trying to prevent "new" domains from
being used by "old" app servers, is that correct? If so, checking that
the DTD/schema for the domain.xml is one of the versions supported by
the app server seems like a reasonable approach.