Monday, February 24, 2014

Production tips#4 : Create a secured domain in Glassfish console and assign it to the GUI in netbeans

What is really the issue here ?
Suppose you want to have your Netbeans IDE and an embedded Glassfish server GF attached to it. By default the web administration console page is not password protected. If you go directely to the web admin console page and change the admin password and hope it to work chances are that you will disappoint yourself. 
If that is the case then what to do ?
1. Go to the command prompt and navigate into the C:\glassfishv3\glassfish\bin.
   Clik on asadmin.bak
    or cd C:\glassfishv3\glassfish\bin
C:\glassfishv3\glassfish\bin> asadmin [ENTER]
asadmin > create-domain --adminport 5555--savemasterpassword domain3
 Follow the shell instruction it is interactive but enter your admin username, admin password and master password (at least 6 characters )
2. Assign the domain we just created to GUI so that we don't need to use the command line or asadmin shell  every time for the server administration.
 Go to Netbeans --> Services -->Servers :
        Right click Servers and Add a Glassfish server
 
Click Next  -->Next  and you are here
 Specify the same domain name you created previously : domain3
 
Finish and Restart you IDE, you can now visit the admin web console page by just right clicking the server name and click View Domain Admin Console  like here below
 Congratulation you just did it, feel to comment ...

No comments:

Post a Comment