Java Application Servers
In this part of the Java EE 5 tutorials, we will mention Java Application Servers (AS).An aplication server is a server side software, that provides the business logic for the application. A Java EE AS is a server application that implements the Java EE platform APIs and provides the standard Java EE services. Java EE AS differs from traditional web server by providing components that handle JSP pages and servlets and by working with databases. The main benefit of an application server is the ease of application development.
A three tier application consists of these parts:
- Front end
- Business logic
- Back end
There are several well known Java EE application servers.
- Tomcat
- Glassfish
- JBoss
- Resin
- OC4J
- WebLogic
- WebSphere
Tomcat
Apache Tomcat is an application server that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. Tomcat is developed by the Apache Software Foundation (ASF). During the installation of the Netbeans IDE, we can choose to install Apache Tomcat AS as well. It is then integrated in the IDE.Starting and stopping Tomcat
$ cd apache-tomcat-6.0.14/bin/We go to the bin direcory located in the installation direcory of the Apache Tomcat AS. To start the server, we launch the startup.sh script.
$ ./startup.sh
Using CATALINA_BASE: /home/vronskij/bin/apache-tomcat-6.0.14
Using CATALINA_HOME: /home/vronskij/bin/apache-tomcat-6.0.14
Using CATALINA_TMPDIR: /home/vronskij/bin/apache-tomcat-6.0.14/temp
Using JRE_HOME: /home/vronskij/bin/jdk1.6.0_03/
Figure: Apache Tomcat AS
Tomcat listens on the 8080 port by default. $ ./shutdown.shTo stop the Apache Tomcat AS, we execute the shutdown.sh script.
Using CATALINA_BASE: /home/vronskij/bin/apache-tomcat-6.0.14
Using CATALINA_HOME: /home/vronskij/bin/apache-tomcat-6.0.14
Using CATALINA_TMPDIR: /home/vronskij/bin/apache-tomcat-6.0.14/temp
Using JRE_HOME: /home/vronskij/bin/jdk1.6.0_03/
Application deployment
To deploy a web application, copy the web archive to the webapps subdirectory of the apache tomcat installation directory.Glassfish
Glassfish is a free and open sourced Java Application server for the Java EE 5. The source code has been donated by Sun Microsystems from it's commercial Java System Application Server. It is now endorsed by the Sun Corporation and the Netbeans project. Glassfish can be controlled from the Netbeans IDE.We can install Glassfish, when we install Netbeans Java EE pack.
Starting and stopping Glassfish
$ ./asadmin start-domain domain1We start the Glassfish server with the asadmin tool. It is located in the bin subdirectory of the Glassfish installation directory.
Figure: Glassfish AS
Glassfish listens on the 8080 port by default. $ ./asadmin stop-domain domain1Here we show, how we stop the Glassfish server.
Web application deployment
We can deploy the web application by copying the web archive to the autodeploy subdirectory.$ asadmin deploy --user=admin ~/programming/jee/form/form.warThis is an alternative method of deployment. Here we must also provide a password for user admin. The default password is adminadmin.
Resin
Resin is high-performance, open source Java EE Applicaiton Server. Resin is created by the Caucho Technology Corporation. The Resin is the AS used in this tutorial. I found Resin to be the fastest AS.Installation
Installation of Resin AS might be complicated. But for educational purposes, we do not need any compilation or advanced configuring. If we want to use Resin as a standalone server, the installation process is pretty easy. We download Resin from www.caucho.com/download. Unpack it to the install dir.Starting and stopping Resin
$ ./httpd.sh startWe go the the bin subdirectory of the Resin installation directory and launch the httpd.sh script with the start parameter.
Resin/3.1.3 started -server ''.
Figure: Resin AS
The Resin Application Server listens on the 8080 port as well. $ ./httpd.sh stopThis is how we stop the Resin.
Resin/3.1.3 stopped -server ''.
Application deployment
The deployment is very easy. We just copy the web archive to the webapps subdirectory.In this part of the JEE tutorial, we have briefly mentioned Java application servers.
0 comments:
Post a Comment