Wednesday, January 4, 2006

J2EE application servers

J2EE application servers

One of the main advantages of ColdFusion MX is that it can be installed as an integrated server (the server configuration) or deployed as a Java application on a standards-based J2EE application server (the J2EE configuration). In addition to greater flexibility, this allows your ColdFusion applications to leverage features of the J2EE architecture, such as support for multiple application instances and multiple-instance clustering.

You can deploy ColdFusion MX in the J2EE configuration using either the bundled copy of Macromedia JRun 4 or a third-party J2EE application server. If you use the bundled version of JRun (recommended), the installation wizard automatically deploys and configures ColdFusion MX 6.1 on its own JRun server. If you choose to use a third-party J2EE application server, the installation wizard creates a web application archive (WAR) or enterprise application archive (EAR) file, which you then deploy using the tools provided by your chosen application server. Choosing EAR or WAR deployment

In the J2EE environment, you deploy applications in one of the following formats:

Web application Contains the ColdFusion MX application. A web application (also called a WAR) uses a directory structure that contains a WEB-INF/web.xml deployment descriptor, which defines the servlets and context parameters it uses. J2EE application servers can deploy web applications in this directory structures as-is or in compressed WAR files that contain these directory structures. However, ColdFusion MX must run out of an expanded directory structure.

cfusion (cfusion.war)

WEB-INF

web.xml

CFIDE

cfdocs

CFIDE (rds.war)

WEB-INF

web.xml

Cfusion.war contains the ColdFusion MX web application. Rds.war is a web application that redirects requests from /CFIDE to /context-root/CFIDE. It forwards requests to the ColdFusion MX Administrator when ColdFusion MX uses a context root other than /.

Enterprise application Contains the ColdFusion MX and RDS redirector web applications.

An enterprise application (also called an EAR) uses a directory structure that contains a META-INF/application.xml deployment descriptor, which defines the web applications it contains. J2EE application servers can deploy enterprise applications in these directory structures as-is or in compressed EAR files that contain these directory structures. However, ColdFusion MX must run out of an expanded directory structure.

cfusion-ear

META-INF

application.xml

cfusion-war

WEB-INF

web.xml

CFIDE

cfdocs

rds.war

WEB-INF

web.xml

If your J2EE application server supports enterprise applications, you should install and deploy the

EAR file. For more information, see “Installing an EAR file or WAR files”

Note: The instructions in this chapter apply to the ColdFusion MX J2EE configuration. The ColdFusion MX server configuration contains an embedded version of JRun, which uses ColdFusion-specific JRun configuration options and mappings. For information on installing ColdFusion MX in the server configuration, see Chapter 2, “Installing the Server Configuration,”

Context root

Because the J2EE environment$ supports multiple, isolated web applications running in a server instance, J2EE web applications running in a server are each rooted at a unique base URL, called

a context root (or context path). The J2EE application server uses this initial portion of the URL (that is, the portion immediately following http://hostname) to determine which web application services an incoming request.

For example, if you are running ColdFusion MX with a context root of cfmx, you display the ColdFusion MX Administrator using the URL http://localhost/cfmx/CFIDE/administrator/index.cfm.

Most J2EE application servers allow one application in each server instance to use / (forward slash) for the context root. Setting the context root to / for the ColdFusion MX application is especially useful when serving CFM pages from the web server because it supports the functionality most similar to previous ColdFusion releases. In addition, the RDS web application is not required if you use a context root of /.

When you deploy the ColdFusion MX EAR file, it uses the context root specified when you ran the installation wizard (which copied your specification to the context-root element of the META-INF/application.xml file). When you deploy ColdFusion MX as a WAR file, you use application-server-specific functionality to define the context root.

Note: Each web application running in a server instance must have a unique context root. The JRun default web application uses / for a context root so if you want to use / for the ColdFusion MX context root when deploying on JRun, you must either delete the default-war application or change the default-war context root by editing the default-ear/META-INF/application.xml file.

Multiple instances

When using the J2EE configuration, you can define multiple server instances on a single computer, each running ColdFusion MX. Running multiple instances of ColdFusion MX has the following advantages:

Application isolation You deploy an independent application to each server instance. Each server instance has separate settings, and because each server instance runs in its own instance

of the JVM, problems encountered by one application have no effect on other applications.

Load balancing and failover You deploy the same application to each server instance and add the instances to a cluster. The web server connector optimizes performance and stability by automatically balancing load and by switching requests to another server instance when a server instance stops running.

For more information on configuring ColdFusion MX on multiple server instances, including detailed information for configuring multiple server instances when running on JRun 4, see Configuring and Administering ColdFusion MX.

Platforms

Full ColdFusion MX functionality is available on Windows, Linux, and Solaris. Additionally, you can install and deploy the all-Java ColdFusion MX J2EE configuration on other platforms, although without the functionality provided by platform-specific binary files (Verity and C++ CFXs).

Preparing to install using the J2EE configuration

This section provides installation instructions for the ColdFusion MX J2EE configuration. When installing the J2EE configuration, you have the following options:

New installation – install JRun 4 Select this option to install a copy of Macromedia JRun 4 with ColdFusion MX deployed and configured as an enterprise application in a JRun server. For installation details, see “Installing the J2EE configuration with JRun”. This is the recommended J2EE configuration option if JRun or another J2EE application server is not already installed on the computer.

New installation – create EAR or WAR Select this option if you already have a J2EE application server running on the computer. The installation wizard creates an EAR file or two WAR files, which you deploy using J2EE application server-specific tools or utilities. For installation details, see “Installing an EAR file or WAR files”.

Update existing ColdFusion MX – redeploy existing EAR or WAR Select this option if ColdFusion MX is already deployed in a J2EE application server running on the computer. With this option, the installation wizard backs up ColdFusion MX settings, backs up CFM pages, and creates and EAR file or two WAR files. You undeploy the current ColdFusion MX application, deploy ColdFusion MX 6.1, and copy the saved settings from the backup directory. For installation details, see “Installing an EAR file or WAR files”.

Note: Migration from ColdFusion 4.5 or 5 to the ColdFusion MX J2EE configuration is not supported. In addition, the J2EE configuration is not supported by ClusterCATS.

No comments: