I’ve had some problem with starting the GlassFish database. It occurs that in GlassFish 3.1 it started together with the Application Server (when you started the domain), but this doesn’t work for me since 3.1.1.
So, if you see something like:
Error connecting to server localhost on port 1527 with message Connection refused: connect.
you can try to start the GlassFish Java DB by yourself. To do this, just invoke:
asadmin start-database
while you’re in GLASSFISH_HOME/bin
directory.