Thursday, November 20, 2008

Glassfish V3 CLI Administration

I installed the Glassfish V3 prelude version on my EC2 instance.
The installation process was very easy, however I kept running into issues managing my multiple domain instances via CLI.

Each time I would try to stop my instance using command line:
asadmin stop-domain --user admin domain1
or
asadmin stop-domain --user admin domain2

I would get the following error:
com.sun.enterprise.cli.framework.CommandException: Authorization has been refused for credentials [user: admin] given in this request.
(Usually, this means invalid user name and/or password)
Command stop-domain failed.

I checked the admin-realm for my admin user and it was there with the SHA encrypted password.

I then ran:
asadmin login -p 4848
Enter admin user name[Enter to accept default]>admin
Enter admin password>adminadmin
GlassFish v3 Prelude (build b28c)

Login information relevant to admin user name [admin] for host [localhost] and admin port [4849] stored at [/home/glassfish/.asadminpass] successfully.
Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage associated domain.
Command login executed successfully.


After successful login the .asadminpass file will be updated in the home directory.

The second domain experienced the same issue so I performed the same asadmin login steps passing my second domain port.

asadmin login -p 4849

The content of my file contains login for both domains.
# Do not edit this file by hand. Use login interface instead.
asadmin://admin@localhost:4848 c4Aba22zdDIwMFg=
asadmin://admin@localhost:4849 c5Aba22zdDIwMFg=