INSTALLING AND RUNNING APPLICATION SERVER FOR EJB
Depending on the requirements of the organisation or company, one may select an
appropriate Application server. If organisation’s business processes span hundreds or
thousands of different computers and servers then, one can select good application serversappropriate Application server. If organisation’s business processes span hundreds or
like BEA Web Logic, IBM Web Sphere and Oracle 9i Application Server etc. which are
licensed servers. But, on the other hand, if, the organisation is really small but still wants
to use EJBs due to future scalability requirements then, there are quite a few EJB
application servers from free and open source to the ones, which are fast, but with
reasonably low license fees. Examples of application servers, which are popular in small
organisations, include JBoss and Orion Application Server.
An application server is a conglomeration of software services that provide a runtime
environment for any number of containers, as shown in the Figure 2. A typical J2EE
application server, such as WebLogic, WebSphere, JBoss, and Sun's J2EE Reference
Server, houses a multitude of containers. WebLogic, for example, supports an EJB
container and a servlet container
environment for any number of containers, as shown in the Figure 2. A typical J2EE
application server, such as WebLogic, WebSphere, JBoss, and Sun's J2EE Reference
Server, houses a multitude of containers. WebLogic, for example, supports an EJB
container and a servlet container
The EJB container provides basic services, including transactions, life-cycle management,
and security, to the EJBs deployed into it. By shouldering much of this burdensome
lower-level functionality, the EJB container significantly reduces the responsibilities of
the EJBs deployed into it. Because EJBs no longer contain the code to provide these
fundamental behaviours, EJB developers are free to concentrate on writing code that
solves business problems instead of computer science problems.
and security, to the EJBs deployed into it. By shouldering much of this burdensome
lower-level functionality, the EJB container significantly reduces the responsibilities of
the EJBs deployed into it. Because EJBs no longer contain the code to provide these
fundamental behaviours, EJB developers are free to concentrate on writing code that
solves business problems instead of computer science problems.
Every application server vendor has its own way of deploying EJBs. They all share some
common traits, however, that are illustrated in Figure 3 and described here:
common traits, however, that are illustrated in Figure 3 and described here:
• An EJB’s class (or sometimes its source code) files and its deployment descriptor
are placed into an archive, which is typically a JAR file. Deployment descriptors are
described in more depth in Part II, “Reference”.
are placed into an archive, which is typically a JAR file. Deployment descriptors are
described in more depth in Part II, “Reference”.
• A deployment tool of some sort creates a deployable archive file (typically, but not
always, a JAR) from the contents of the archive created in Step 1.
always, a JAR) from the contents of the archive created in Step 1.
• The deployable archive file is deployed into the EJB container by editing the
container's configuration file or by running an administrative interface program.
container's configuration file or by running an administrative interface program.
There are many free application servers like Sun's J2EE Reference Application Server,
which is available free at http://www.javasoft.com. Or Jboss, which may be downloaded
JBoss from JBoss web site: www.jboss.org. Current stable version is 2.4.3. Download it
from their web site. Once you have downloaded it, unzip the JBoss zip file into some
directory e.g. C:\JBoss. The directory structure should be something like the following
which is available free at http://www.javasoft.com. Or Jboss, which may be downloaded
JBoss from JBoss web site: www.jboss.org. Current stable version is 2.4.3. Download it
from their web site. Once you have downloaded it, unzip the JBoss zip file into some
directory e.g. C:\JBoss. The directory structure should be something like the following
C:\JBoss
admin
bin
client
conf
db
admin
bin
client
conf
db
deploy
lib
log
tmp
lib
log
tmp
Now, to start JBoss with default configuration go to JBoss/bin directory and run the
following command at the DOS prompt :
following command at the DOS prompt :
C:\JBoss\bin>run
run.bat is a batch file which starts the JBoss Server. Once JBoss Server starts, you should
see huge lines of text appearing on your command prompt screen. These lines show that
JBoss Server is starting. Once JBoss startup is complete you should see a message like
following one on your screen
[Default] JBoss 2.4.3 Started in 0m:11s
Now, we have successfully installed and run JBoss on your system. To stop JBoss, simply
press Ctrl + C on the command prompt and JBoss will stop, after displaying huge lines of
text
The client for our EJB will be a JSP page / Java Servelet running in a separate Tomcat
Server. We have already learnt in an earlier Block 1, how to create and install Tomcat
server for running JSP page or Servlet
Configuring and Running Tomcat
Create a new folder under the main C:\ drive and name it “Projects”. Now, create a new
sub-folder in the C:\Projects folder and name it "TomcatJBoss". The directory structure
should look like the following
C:\Projects
TomcatJBoss
Now, open conf/Server.xml file from within the Tomcat directory where you have
installed it. By default this location will be
C:\Program Files\Apache Tomcat 4.0\conf\server.xml
Somewhere in the middle where you can see multiple <Context> tags, add following lines
between other <Context> tags :
<!-- Tomcat JBoss Context -->
<Context path=”/jboss” docBase=“C:\Projects\TomcatJBoss\” debug=“0”
reloadable= “true” />
Now, save Server.xml file. Go to Start -> Programs -> Apache Tomcat 4.0 -> Start
Tomcat, to start Tomcat Server. If everything has been setup correctly, you should see the
following message on your command prompt:
No comments:
Post a Comment