Recently I had to work with one old glassfish server and need to change some jvm values to optimize the server performance.
I got so many blogs, forums how to reset the admin password which all telling that we need to backup the existing domains and created new one for taking config files etc.. that’s all making confusions and included unwanted steps.
Replace the file “admin-keyfile” under “/var/glassfish/domains/domain1/config/” with same of any of working domains file. So that password will be same used in domains used earlier and you may change the password once after the login.
Steps are ,
[root@svr-01 ~]# cd /var/glassfish/domains/domain2/
[root@svr-01 domain2]# cd config/
[root@svr-01 config]# cp /var/glassfish/domains/domain3/config/admin-keyfile .
cp: overwrite `./admin-keyfile'? y
[root@svr-01 config]# /var/glassfish/bin/asadmin start-domain domain2
I can login domain2 on using the domain3 admin credentials. Now you can change the password to new one.
Isn’t so simple !!!!! Njoy …