Accessibility
 
Home / Products / ColdFusion / Support
J2EE Support

Installing and Deploying ColdFusion MX 6.1 on Tomcat

Macromedia ColdFusion MX 6.1 supports both a server configuration (which includes an embedded version of JRun) and J2EE configuration (which lets you deploy ColdFusion MX as a Java application running on a Java 2 Enterprise Edition (J2EE) application server.) When you run ColdFusion MX 6.1 in the J2EE configuration, you use the application server's deployment mechanism to deploy ColdFusion MX on a J2EE 1.3 compliant application server. The Installation Wizard lets you install ColdFusion MX as an enterprise application or as a web application. Web application support lets you deploy the ColdFusion MX J2EE configuration on standalone J2EE web containers, such as Tomcat.

About this document

Installing, deploying, and configuring ColdFusion MX 6.1

Usage notes

About this document

This document provides instructions for deploying and configuring ColdFusion MX in the J2EE configuration on Tomcat version 4.1.12 and later. It refers to overview information in Installing and Using ColdFusion MX, which is available on LiveDocs (English and Japanese only).

Conventions in this document

This document uses the following conventions to reference Tomcat and ColdFusion directories:

  • cfmx_install_directory - The directory that contains the files extracted by the ColdFusion MX for J2EE installer; for example, C:\cfmx or /opt/cfmx.
  • tomcat_root - The directory that contains Tomcat; for example, C:\jakarta-tomcat-4.1.18.
  • cf_root - The directory into which you deployed ColdFusion MX; for example, C:\jakarta-tomcat-4.1.18\webapps\cfusion.
  • java_home - The root directory of your Java 2 software development kit (J2SDK); for example, C:\j2sdk1.4.1.

Installing, deploying, and configuring ColdFusion MX 6.1

You deploy ColdFusion MX 6.1 in the J2EE configuration on Tomcat using WAR files in conjunction with Tomcat autodeploy.

Note: If you are updating a currently deployed version of ColdFusion MX on JRun, see the instructions in Enabling and Using ColdFusion MX Features on Your J2EE Server before continuing.

To install ColdFusion MX 6.1 on Tomcat:

  1. Run the ColdFusion MX 6.1 Installation Wizard after downloading the platform-specific installer:
    • Windows - coldfusion-61-win.exe
    • Linux - coldfusion-61-lin.bin
    • Solaris - coldfusion-61-sol.bin
    • Other platforms - coldfusion-61-other.jar (run with java_home/bin/java -jar coldfusion-61-other.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. When prompted, do the following:
    1. Select Developer Edition.
    2. Select J2EE configuration/WAR file
    3. Specify the installation directory
    4. Specify a password for use with the ColdFusion MX Administrator.

      The Installation Wizard places the cfusion.war and rds.war files in the installation directory.

  3. Stop the Tomcat server to which you will deploy ColdFusion MX.
  4. Copy the cfusion.war and rds.war files from the installation directory to the webapps directory.
  5. Rename the rds.war file to CFIDE.war (CFIDE must be all capital letters).
  6. Start your Tomcat server.

    Tomcat automatically detects the presence of the cfusion.war and CFIDE.war files, autodeploys them, and creates expanded cfusion and CFIDE subdirectories. This could take some time.

  7. Stop your Tomcat server.
  8. ColdFusion MX 6.1 includes a 1.4.2 version of the tools.jar file. If Tomcat uses a different JDK version, rename your tomcat_root/webapps/cfusion/WEB-INF/cfusion/lib/tools.jar file 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 the following ColdFusion binary file directories to the system path:

      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. Uncomment this line 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 * Uncomment this line if you've configured CORBA
    rem set CF_JVM_OPTIONS=%CF_SECURITY_JVM_OPTIONS% %CF_CORBA_JVM_OPTIONS%
    rem * Uncomment 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 the catalina.bat file
    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 the 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"
    
    # If using sandbox security,
    # 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).
    # For JDK 1.4.1 and higher, specify
    # com.gp.java2d.ExHeadlessGraphicsEnvironment instead of
    # com.gp.java2d.ExGraphicsEnvironment. 
    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. Restart the Tomcat server and monitor startup messages to ensure that all configurations were applied successfully.
  11. Start the ColdFusion Administrator and run the Configuration Wizard. You start the Administrator using a URL of the form http://hostname:portnumber/cfusion/CFIDE/administrator/index.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).
  12. Code and test ColdFusion MX (CFM) pages. Store these pages in the cfusion web application root 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.

Usage notes

Japanese

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

Setting the crossContext attribute to enable RDS

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:

  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. Select 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:

  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.