Reset GlassFish Password

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

  1. Removed the current password information from the GlassFish domain I was using.

    Prompt> rm -rf /Users/your_username/.asadminpass
  2. 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
  3. Created a new domain

    Prompt> ./asadmin create-domain --adminport 4848 domain2
  4. Transfer authentication files from Domain2 to Domain1

    Prompt> /Users/your_user/SUNWappserver/domains/Domain2/config
    Prompt> cp -R cacerts.jks admin-keyfile keyfile keystore.jks ../../domain1/config/
  5. Start the server

    /Users/your_user/SUNWappserver/domains/domain1/bin
    ./startserv

Advertisements

8 thoughts on “Reset GlassFish Password

  1. Thanks, this was very helpful, in particular identifying admin-keyfile as the file I needed to put back to get back the original password of “adminadmin”.

  2. To answer the question: how do you enter into the admin console when you don’t know the password, please see below:

    login is: admin

    somewhere in the below folder hierarchy, find text file called: local-password which has bunch of alpha numeric [hexadecimal i guess]

    glassfish3\glassfish\domains\domain1\config\

    anyway, use that hexadecimal code as your password to enter into the admin console, then change it to what you want to change the password to.

    Enjoy!

    Venkat

  3. Yo lo que hize fue desintalar el Glass desde Netbeans, luego eliminar los archivos desde la carpeta raíz.

    Primer paso: Cree un nuevo domain
    Resultado podía levantar el server pero no podía entrar en la consola.Netbeans pedía pass a cada momento.

    Segundo Paso(Exitoso)
    Desintalar el Glass desde Netbeans, luego eliminar los archivos desde la carpeta raíz.
    Descargué el Glass .zip desde la web oficial el link:

    Instalé el Glass desde el archivo descargado.

    Resultado.podía levantar el server y entrar en la consola localhost:4848.

    Espero que a alguien le sirva

    Saludos

    /////////////////////////////

    I uninstall the Glass from Netbeans, then delete the files from the root folder.

    First step: Create a new domain
    Outcome could lift the server but could not enter the pass consola.Netbeans asked many times.

    Second Step (Successful)
    Uninstall the Glass from Netbeans, then delete the files from the root folder.
    I downloaded the zip Glass from the official website link.:

    I installed the Glass from the downloaded file.

    Result could lift the server and enter the console localhost: 4848.

    I hope someone will serve

    regards

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