Installing GlassFish , Creating Domains , Deploying Applications to GlassFish Server

Installing GlassFish , Creating Domains , Deploying Applications to GlassFish Server
0 votes, 0.00 avg. rating (0% score)


The GlassFish  is Sun’s open source application server.


GlassFish includes many technologies such as  JavaServer Pages(JSP) 2.1, JavaServer Faces(JSF) 1.2, Servlet 2.5, Enterprise JavaBeans 3.0, Java API   for Web Services(JAX-WS) 2.0, Java Architecture for XML Binding(JAXB) 2.0 etc.


Installing GlassFish


To install GlassFish application server first you need to  install JDK 5 or JDK 6 .


(http://www.sun.com/download/index.jsp?cat=Java%20%26%20Technologies&tab=3&subcat=Java )


Ant is used for configuration processing(Ant 1.6.5)


Steps for installing GlassFish to your system:


–> Download one of the glassfish bundles to disk (https://glassfish.dev.java.net/public/downloadsindex.html )

–> Set your JAVA_HOME  to the JDK you have installed

–> run java -Xmx256m –jar glassfish_bundle_filename.jar(glassfish-installer-v2.1.1-b31g-windows.jar etc.)

After running  this command a directory will be created named “glassfish”

–> For unix users set the execute permission for the Ant files :


cd glassfish


chmod -R +x lib/ant/bin


–>run     lib/ant/bin/ant -f setup.xml command for unix or  libantbinant -f setup.xml for windows user .


Creating  A Domain


–> run asadmin create-domain –adminport 4848 –profile developer testdomain


–profile


The profile of the domain available values for profile parameter : enterprise, cluster or developer  default value is developer.


–adminport


The  port for administration


–> Set your passwords from command line

Starting  the Domain


1)   Solaris and Linux


–> Add the install_directory/bin/(…glassfish/bin) directory to the PATH environment variable.

–> run asadmin start-domain test domain


2)   Windows


–> From the Explorer window or desktop, right click My Computer.

–> Choose Properties

–> Click the Advanced tab.

–> Click Environment Variables.

–>In the User variables section:


–> If a PATH variable exists, add install-diectorylbin;other_entries.(..glasssfishbin)

–> If a PATH variable is not present, add a  new variable. In  Variable Name, type PATH. In variable value,

Type install-dirbin;other_entries.(..glasssfishbin )

–> Add a new environment variable AS_ADMIN_USER and set it to the Administrative User Name that you assigned during installation.

–> Open  Command Prompt and go to installation directory and run  the following command:

asadmin start-domain testdomain


Admin Console


–> type http://localhost:4848

–> enter admin username and your password set above steps and login



You can manage your domain from this console app.

You can add clustering property to servers , see logs, filter logs etc.


Deploying Applications


–> Create sample Hello World web application , add  a simple index.jsp page in your application to test your  application and  export your application as HelloWorld.war.


–>There are two ways to deploy applications

1) Copy this war file to  to your  domain’s autodeploy directory.  This application will be deployed with no other effort.

2) Open the Admin Console http://localhost:4848

Click  Applications –> Web Applications –> Deploy

Select an application to  deploy and click deploy






Testing Deployed Application



Open http://localhost:4848

Click Applications–>Web Applications

You will see your web application



Click Launch new HelloWorld web application and test your app .


Tagged with: , , , , ,
Posted in Blog
3 Comments » for Installing GlassFish , Creating Domains , Deploying Applications to GlassFish Server
  1. kidd says:

    ya mon very niceee!!

  2. Andrzej says:

    Hello,

    I tried to add a new environment variable AS_ADMIN_USER but during installation I did not see any mention about Administrative User Name. How can I find it or set this user?

    Regards,
    Andrzej

  3. babanna duggani says:

    Thanks for the valuable info.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


five + = 14

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>