Pages

Saturday, 9 February 2013

Deploying EAR file inside glassfish on Ubuntu Machine


In this post we will go through the minimal steps required to deploy EAR file inside glassfish server on Ubuntu linux machine.

Minimal Steps Required


1. Install Sun jdk 1.6 or higher from here if not already installed but first remove any other jdk versions if they were installed previuosly. 

2. Download and install glassfish application server with following simple commands.

wget http://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1-unix.sh
sh glassfish-3.1.1-unix.sh


As we can configure glassfish server after its installation therefore we can skip configuring glassfish while its installation.

3. Create a new domain with following simple command.

asadmin create-domain –adminport 4848 –profile developer domain1

where 4848 is default admin port. However in my case admin port was 14889.

4. Next set admin password with following commands (Assuming that glassfish3/bin directory is already added to the PATH variable).

asadmin --user admin
asadmin> change-admin-password --user admin
Enter admin password>[Press Enter key as default is empty value]   
Enter new admin password>adminpass
Enter new admin password again>adminpass
Command change-admin-password executed successfully.


5. Now open Glassfish Administration Console and provide the admin user credentials.



6. Once you sign in go to the "Deploy an Application" link under Deployment menu.



7. Now select the EAR file to be deployed and click on OK button.




The EAR file was successfully deployed in the last step and that can be easily tested by accessing our application from the browser.