Accessibility
 
Home / Products / ColdFusion / Support
Macromedia ColdFusion Support Center J2EE Support

Installing ColdFusion MX for J2EE on Tomcat

Contents

Overview
Installing, deploying, and configuring ColdFusion MX


Overview

The second release of Macromedia ColdFusion MX for J2EE bundles the ColdFusion application in an archive file and includes an installation procedure in which you use the application server's deployment mechanism to deploy ColdFusion MX on a J2EE 1.3 compliant application server. Because ColdFusion MX ships as a web application, you can also deploy it on J2EE stand alone web containers, such as Tomcat.

This document provides instructions on deploying ColdFusion MX for J2EE on Tomcat 4.1.12 and higher. It refers to overview information in the Installing and Using Macromedia ColdFusion MX for J2EE book, which is available on the CD and on LiveDocs (English only).

The remainder of this document describes ColdFusion MX WAR file deployment and configuration on Tomcat. Before continuing, you should read the ColdFusion MX for J2EE Release Notes. You should also read at least the first chapter of Installing and Using ColdFusion MX for J2EE.


Back to Contents

 

Installing, deploying, and configuring ColdFusion MX

You deploy ColdFusion MX for J2EE on Tomcat using WAR files in conjunction with Tomcat autodeploy.

To install ColdFusion MX for J2EE servers on Tomcat, do the following:

1.
Run the ColdFusion MX for J2EE install procedure, downloading and executing the platform-specific installer:
  • Windows - coldfusion-j2ee-win.exe
  • Linux - coldfusion-j2ee-linux.bin
  • Solaris - coldfusion-j2ee-solaris.bin
  • Other platforms - coldfusion-j2ee-java.jar (run with java_home/java -jar coldfusion-j2ee-java.jar -i console)

These installers are available on the Macromedia website. There is no Tomcat-specific installer; you can download any version that matches your platform.

2.
Answer the questions and select an install directory. When prompted to select EAR file or WAR file, select WAR file.
3.
Stop the Tomcat server to which you will deploy ColdFusion MX.
4.
Copy cfusion.war and rds.war to the webapps directory.
5.
Rename rds.war to CFIDE.war.
6.

Start Tomcat server. Tomcat automatically detects the presence of cfusion.war and CFIDE.war, auto-deploys them, and creates expanded cfusion and CFIDE subdirectories. This could take some time.

7.

Stop Tomcat server.

8.

Rename tomcat_root/webapps/cfusion/WEB-INF/cfusion/lib/tools.jar to something else (for example, tools.old).

9.

(Windows, Linux, and Solaris) Create a batch file (Windows) or shell script (Linux and Solaris) to establish environment variables and JVM options used when starting Tomcat. Name this file setenv.bat (Windows) or setenv.sh (Linux and Solaris) and store it in the tomcat_root/bin directory. At Tomcat startup, the catalina.bat file (Windows) or catalina.sh file (Linux and Solaris) automatically calls the setenv file. This file must perform the following steps:

  • Add ColdFusion binary file directories to the system path. These directories are as follows:
    • ColdFusion MX binaries - cf_root/WEB_INF/cfusion/lib
    • Verity binaries - cf_root/WEB_INF/cfusion/lib/platform/bin (where platform is _nti40, _ilnx21, or _solaris)
    • jIntegra binaries (Windows only, COM support)- cf_root/WEB-INF/cfusion/jintegra/bin and cf_root/WEB-INF/cfusion/jintegra/bin/international
  • Set JVM options to enable Sandbox Security, graphing (only required for Linux and Solaris), and CORBA support (CORBA support is optional).

The following example Windows batch file sets the system path and adds JVM options to the JAVA_OPTS environment variable, which is used in the startup command:

rem Set a few variables.
set JAVA_HOME=c:\j2sdk1.4.0
set CF_HOME=C:\jakarta-tomcat-4.1.12\webapps\cfusion
set CF_WEB_INF=%CF_HOME%/WEB-INF

rem Concatenate binary file directories into a single variable.
set CF_SHARED_LIB=%CF_WEB_INF%/cfusion/lib
rem The following variable must be on a single line.

set CF_SHARED_LIBS=%CF_SHARED_LIB%;%CF_SHARED_LIB%/_nti40/bin;
%CF_WEB_INF%/cfusion/jintegra/bin;
%CF_WEB_INF%/WEB-INF/cfusion/jintegra/bin/international

rem Add libraries for binary files to the Windows system path.
set PATH=%PATH%;%CF_SHARED_LIBS%

rem Set JVM options to enable sandbox security (all on one line).
set CF_SECURITY_JVM_OPTIONS=-Djava.security.manager
-Djava.security.policy="%CF_WEB_INF%/cfusion/lib/coldfusion.policy"
-Djava.security.auth.policy="%CF_WEB_INF%/cfusion/lib/neo_jaas.policy"

rem Set JVM options for CORBA. Use if vbjorb.jar is not in
rem your JRE's lib/ext directory.

rem set CF_CORBA_JVM_OPTIONS=-Xbootclasspath/a:"%CF_WEB_INF%/lib/vbjorb.jar"

rem Consolidate JVM options.
rem * Use this line if you've configured CORBA
rem set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS% %CF_CORBA_JVM_OPTIONS%
rem * Use this line if you haven't configured CORBA
set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS%

rem Populate JAVA_OPTS, which will be used by catalina.bat
rem when starting the JVM.
set JAVA_OPTS=%CF_JVM_OPTIONS%

The following example UNIX shell script sets the system path and adds JVM options to the JAVA_OPTS environment variable, which is used in the startup command:

# Establish variables
JAVA_HOME="/usr/java/jdk1.3.1_06"
CF_HOME="/opt/tomcat/webapps/cfusion"
CF_WEB_INF=$CF_HOME/WEB-INF

# Add binary file directories to system path
CF_SHARED_LIB=$CF_WEB_INF/cfusion/lib
CF_SHARED_LIBS=$CF_SHARED_LIB:$CF_SHARED_LIB/_ilnx21/bin
LD_LIBRARY_PATH="$CF_SHARED_LIBS:$LD_LIBRARY_PATH"

# Establish security JVM options (all on one line).
CF_SECURITY_JVM_OPTIONS="-Djava.security.manager
-Djava.security.policy=$CF_WEB_INF/cfusion/lib/coldfusion.policy
-Djava.security.auth.policy=$CF_WEB_INF/cfusion/lib/neo_jaas.policy"
# Establish graphics JVM options (all on one line).
CF_GRAPHICS_JVM_OPTIONS="-Xbootclasspath/a:$JAVA_HOME/lib/tools.jar:
$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/jre/lib/i18n.jar:
$CF_WEB_INF/cfusion/lib/webchartsJava2D.jar
-Djava.awt.graphicsenv=com.gp.java2d.ExGraphicsEnvironment"
# Set JVM options for CORBA. Use if vbjorb.jar is not in your JRE's
# lib/ext directory.
If used, append $CF_CORBA_JVM_OPTIONS to CF_JVM_OPTIONS
# CF_CORBA_JVM_OPTIONS=-Xbootclasspath/a:"$CF_WEB_INF/lib/vbjorb.jar"
CF_JVM_OPTIONS="$CF_SECURITY_JVM_OPTIONS $CF_GRAPHICS_JVM_OPTIONS"

JAVA_OPTS="$CF_JVM_OPTIONS -Xms128m -Xmx256m"

export LD_LIBRARY_PATH

10.

If you deployed the RDS application, you must also set the crossContext attribute to true for the CFIDE web application. You can do this through the Tomcat Administrator or by editing the tomcat_root/conf/server.xml file manually.

To set the crossContext attribute through the Tomcat Administrator, perform the following steps:

  1. Restart Tomcat.
  2. Open the Tomcat Administrator (http://servername:8080/admin). If you've never used the Administrator, open the tomcat_root/conf/tomcat-users.xml file in a text editor and define a user in the admin role.
  3. Go to Tomcat Server > Service (Tomcat-Standalone) > Host (localhost).
  4. Click on Context (/CFIDE).
  5. Set the Cross Context field to true.
  6. Click Save.
  7. Click Commit Changes.

To set the crossContext attribute by editing the server.xml file, perform the following steps:

  1. Open the tomcat_root/conf/server.xml file in a text editor.
  2. Add the following line under the Engine element:

    <Context className="org.apache.catalina.core.StandardContext"
    cachingAllowed="true"
    charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true"
    crossContext="true" debug="0" displayName="CFMX RDS Application"
    docBase="C:/jakarta-tomcat-4.1.12/webapps/CFIDE"
    mapperClass="org.apache.catalina.core.StandardContextMapper"
    path="/CFIDE" privileged="false" reloadable="false" swallowOutput="false"
    useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
    </Context>

  3. Save and close the server.xml file.

 

11.

Restart the Tomcat server and monitor startup messages to ensure that all configurations were applied successfully.

12.
Start the ColdFusion Administrator and run the startup wizard, as explained in the Installing and Using ColdFusion MX for J2EE book.

Note: The startup wizard is a pop-up window. To make sure that the wizard appears, disable any software options that prevent your web browser from displaying pop-up windows.

13.

Code and test ColdFusion MX CFM pages. Store these pages in the cfusion web application root, as described in the "Using ColdFusion MX Applications
with J2EE Application Servers
" chapter of the Installing and Using ColdFusion MX for J2EE book. You typically access these pages through the built-in Tomcat web server and use a URL of the form http://hostname:portnumber/cfusion/filename.cfm, as follows:

  • hostname - The machine name, IP address, localhost, or 127.0.0.1.
  • portnumber - The port number of the Tomcat web server, typically 8080.
  • filename - The directory path and file to display. The path is relative to the cfusion directory.

For example, to display a CFM file located at /Jakarta-4.1.18/webapps/cfusion/eisapp/index.cfm, you could specify the URL as http://127.0.0.1:8080/cfusion/eisapp/index.cfm.

 

Japanese

When you start Tomcat with -Duser.language=ja -Duser.region=JP -Duser.country=JP, the getLocale function returns English(US) instead of Japanese.


Back to Contents