Bistro!
Alexis Moussine-Pouchkine's Weblog
public enum Topic { Java, GlassFish, Tools, Sun, InFrenchInZeText, SDPY }

20070831 vendredi août 31, 2007

GlassFish tip: Broken or Corrupted domain.xml

domain.xml (located in GLASSFISH_INSTALL/domain/DOMAIN_NAME/config) is a key configuration file in GlassFish and it should never be edited by hand. So now that I've said this, I'd be lying if I said I never did this myself. And yes I've had times when my config file was corrupted which would prevent GlassFish from starting. If you end up with a corrupted domain.xml file *without* editing it by hand (never happened to me), you have one thing to do: file a bug with steps to reproduce.

If for some reason domain.xml is indeed corrupted (malformed XML or not compliant to the associated DTD), here are a few things you can do before or after the corruption:

• run the following command to verify the correctness of the file :
%asadamin verify-domain-xml

• restore the entire domain :
%asadmin restore-domain
...if you had previously backed it up :
asadmin backup-domain

• if you're happy losing all domain configuration (deployed applications, JDBC resources, JVM options, ...) or desperately want to get back to a working domain, you can create a new one :
%asadmin create-domain

...or recreate default domain1 by first deleting it :
%asadmin delete-domain domain1
and running the setup script again from the root directory :
ant -f setup.xml

• You can also try to fix the content of this config file with a smart XML editor providing code completion, color syntaxing and well-formeness verification based on its DTD. If you're using NetBeans, go to "DTDs and XML Schema Catalogs".

( août 31 2007, 10:16:00 AM CEST ) Permalink Comments [2]

Comments:

...the proposed solution is to reinstall Glassfish?

Posted by 213.140.6.116 on août 31, 2007 at 02:21 PM CEST #

You really shouldn't have to get to that point but the initial person asking about this is learning Java EE, so that wasn't really a problem. Backuping your domain is really what you should be doing.

Posted by Alexis MP on août 31, 2007 at 10:03 PM CEST #

Post a Comment:

Comments are closed for this entry.

Join us at CommunityOne
ALT DESCR
Tags
Links