Resin: The Instant Application Server

Imagine a Java Web application server that runs on Unix,
delivers incredible performance, is really easy to set up, and inexpensive to boot.
Even crazier, imagine that this little app server offers all of the features you expect
from a modern Java server, including JSP/servlets, XML/XSL, and EJB/CMP.

You can stop imagining. It actually exists, and it goes by the name of Resin.
In this article, we will show you how to install Resin and get it running; we'll conclude
with an EJB/CMP example that shows how Resin makes these techniques easily usable.
If you have worked with installations of Java servers before, I
think you will be amazed at how fast and simple Resin is. At an ISP I worked for, we had Resin up and running in a matter of minutes.

Getting And Installing Resin

We'll start out by installing Resin on our system. Since Resin is itself a Java
application, it needs a Java environment to compile and run. If you don't
already have them, you need to download and install both the Standard Edition
(SE) and the Enterprise Edition (EE) of the JDK (version 1.3.1 or higher).
See java.sun.com for
instructions on how to accomplish this. Note that you will not be able to follow
the steps later in this article if you don't have a working installation of JDK
EE. This is because we will install the Enterprise Edition of Resin, which
requires JDK EE to work.

With both the SE and EE JDKs set up, we can begin our adventure by downloading
and unpacking the Resin source distribution, available
here.
At the time if this writing, the latest version of Resin-EE (Enterprise Edition)
was 2.1.

When the file is on your local machine, just unpack it into your
/usr/local directory.

Since we're going to run Resin as a standalone Web server, we need
to change the port the server will listen on before we start it.
This can be done by changing a line in /usr/local/resin/conf/resin.conf.
Open resin.conf in an editor and locate the following line:

<http port='8080'/>

It's very common to use Resin in conjunction with Apache, letting Resin answer
requests to JSP/servlets, and leaving the rest to Apache.
This is why Resin is set to listen to port 8080 instead of 80, which is the standard port
for Web servers. We are going to let Resin take care of all requests
to our server (which it actually is very capable of!) so we will change the port to 80 in
the above line. Save the file and exit the editor.