users@glassfish.java.net

Re: Windows service asks for admin password when starting

From: <glassfish_at_javadesktop.org>
Date: Wed, 15 Aug 2007 09:07:05 PDT

Yes, it is possible. The trick lies in creating the domain. Remember, creation of a domain works
in concert with starting it. If you make the provisions during creation, startup of domain will be
facilitated. I encourage you to do some experiments and then you'll see some real goodies in GlassFish:

1- Remove ~/.asadminpass (~ refers to your home folder).
    -- "asadmin crate-domain --adminport 4848 foodomain". Observe that no ~/.asadminpass is
       created.
    -- now do: "asadmin crate-domain --adminport [b]--savelogin[/b] 4848 foodomain. Observe that
       ~/.asadminpass is created! This file contains the encoded admin user and password and its
       access permissions are set to 600 (on Unix platforms, where [i]chmod[/i] works). Note: The
       password is NOT encrypted/hashed.

2- Now start the domain.
    -- In case of no ~/.asadminpass, the start-domain command would prompt you for admin
       user and password for a domain that's cluster aware.
    -- In case of ~/.asadminpass, the start-domain will look for the relevant entry in
       ~/.asadminpass and use the admin user and password from there!

3. ~/.asadminpass can contain admin user and password for multiple domains. The entries are
keyed on admin server's host name and admin port number (e.g. localhost, 4848).

4. Not all domains are born same :). A domain that does not deal with clusters (e.g. the so-called
developer profile domain) is not required to have any admin user and password at the
[i]startup[/i]. A domain with cluster support, on the other hand, requires admin user and password
at the startup so that it can communicate with other entities in the domain (e.g. node-agent).

Moderately interesting, eh?

Regards,
Kedar
[Message sent by forum member 'km' (km)]

http://forums.java.net/jive/thread.jspa?messageID=230977