A few weeks ago I installed the latest J2EE on Mac OSX in readiness for an upcoming course. So I have finally had a few minutes to go over the basics and whipped up a quick Web App using Enterprise JavaBeans. Actually really cool and has a similar theory of dealing with databases using (as Ruby on Rails developer would call it Introspection) Annotation.
I went to run the application using GlassFish server and had absolutely no idea what the Admin password was. After realizing that I was never going to guess it I tried the following.
WARNING: Do this at your own risk I am just playing and this application is not important
Removed the current password information from the GlassFish domain I was using.
Prompt> rm -rf /Users/your_username/.asadminpass
Ran the asadmin tool to back up the one and only domain that I have so far
Prompt> cd /Users/your_username/SUNWappserver/bin/
Prompt> ./asadmin backup-domain domain1
Created a new domain
Prompt> ./asadmin create-domain --adminport 4848 domain2
Transfer authentication files from Domain2 to Domain1
Prompt> cp -R cacerts.jks admin-keyfile keyfile keystore.jks ../../domain1/config/
Start the server