Glassfish hit the fan

While changing the JMS setting in Glassfish V2 from embedded to local, the whole box (XP PRO) crashed with a nice screen showing the color of the sky. After restarting Windows, Glassfish complains..

Starting Domain domain1, please wait.
Log redirected to E:\Program Files\glassfish-v2ur2\domains\domain1\logs\server.log.
Error refreshing ConfigContext:E:\Program Files\glassfish-v2ur2\domains\domain1\config\domain.xml
cause: Failed to create the XML-DOM Document.  Check your XML to make sure it is correct.
Content is not allowed in prolog.
Error refreshing ConfigContext:E:\Program Files\glassfish-v2ur2\domains\domain1\config\domain.xml
cause: Failed to create the XML-DOM Document.  Check your XML to make sure it is correct.
Content is not allowed in prolog.

It seems the crash (which I not suspect to be caused by Glassfish) corrupted the domain.xml settings file which normally show something like

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE domain PUBLIC “-//Sun Microsystems Inc.//DTD Application Server 9.1 Domain//EN” “http://www.sun.com/software/appserver/dtds/sun-domain_1_3.dtd”&gt;
<!– Generated from default-domain.xml.template –>
<!– Avoid manual edits of this file. Run “asadmin verify-domain-xml” otherwise.–>
<domain application-root=”${com.sun.aas.instanceRoot}/applications” log-root=”${com.sun.aas.instanceRoot}/logs”>
<applications>
<j2ee-application availability-enabled=”false” directory-deplo…

turned into some 30kb rubbish.

Trying to asadamin verify-domain-xml obviously shows the same result.

A asadmin restore-domain I cant do because I never asadmin backup-domain before.

Either you re-install glassfish or just copy a domain.xml from a similar (!) installation. It worked for me since only very few applications were running on the other box which I took the file from. Replacing the binary rubbish and Glassfish started again.

Conclusion: Make backups of your application server, even dev box. It cost me 1 hour to get it running again without backup.

Correction 03.01.2009: Copying the domain.xml does not work. I try to make changes in the settings with the admin console and get strange error messages. I still ended up re-installing Glassfish.

Note: Glassfish, if  installed together with Netbeans, has a separate de-installer, so you dont need to de-install everything !

Advertisements

One thought on “Glassfish hit the fan

  1. Great idea. I also use Mozy to backup my desktop/laptop regularly. In addition, Time Machine on the Mac and the more flexible TimeSlider on OpenSolaris are also good ideas for developers.

    John Clingan
    GlassFish Group Product Manager

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s