ColdFusion 8 supports JBoss with the following specifications:J
- JBoss 4.0.5 (uses Tomcat 5.5 Server Container)
- Sun JRE 1.4.2_09, Sun JRE 1.5, and Sun JRE 1.6
- Host OS - Windows 2003 server SP1 and RH Linux 4 AS
ColdFusion 8 does not support the following:
- ColdFusion deployment on a clustered JBoss environment
- JBoss using a servlet container other than Tomcat
- Operating systems that are not in the previous list
Note: If you are already using an application with context root of /, you must use a context root other than / for the cfusion-ear file. If you specified / when you installed ColdFusion, you can change it by opening the cfusion-ear/META-INF/application.xml file in a text editor and modifying the context-root element. After you deploy the cfusion-ear file, you access ColdFusion pages by specifying http://hostname:portnumber/contextroot/pagename
.cfm.
If you are updating an existing deployment of ColdFusion MX, ColdFusion MX 6.1, or ColdFusion MX 7 for J2EE, you must undeploy ColdFusion MX, ColdFusion MX 6.1, or ColdFusion MX 7 for J2EE before you deploy ColdFusion 8, as described in Updating from an earlier version for J2EE.
When you deploy ColdFusion on an existing version of JBoss, you must expand the EAR file or WAR files manually before deployment.
Expand the EAR file
- Expand the EAR file by performing the following steps:
- Open a console window, navigate to the directory that contains the EAR file, and create a directory named cfusion-ear:
md cfusion-ear (mkdir cfusion-ear on UNIX)
- Change to the cfusion-ear directory and expand the cfusion.ear file with the jar command:
cd cfusion-ear
java_home/bin/jar -xvf ../cfusion.ear
This expands the cfusion.ear file into cfusion.war and rds.war (rds.war is not included if you specified a context root of / when you ran the installation wizard).
- In cfusion-ear, create a directory named cfusion-war.
md cfusion-war (mkdir cfusion-war on UNIX)
- Change to the cfusion-war directory and expand the cfusion.war file with the jar command:
cd cfusion-war
java_root/bin/jar -xvf ../cfusion.war
This expands the cfusion.war file.
- (If rds.war exists) Go up one level to cfusion-ear, create a directory named rds-war.
cd ..
md rds-war (mkdir rds-war on UNIX)
- (If rds.war exists) Change to the rds-war directory and expand rds.war with the jar command:
cd rds-war
java_root/bin/jar -xvf ../rds.war
This expands rds.war.
- Go up one level to the cfusion-ear file, and delete the cfusion.war and rds.war files:
cd ..
del cfusion.war (rm cfusion.war on UNIX)
del rds.war (rm rds.war on UNIX)
- Open the cfusion-ear/META-INF/application.xml file in a text editor.
- Change the web-uri element from cfusion.war to cfusion-war (or the name of the directory that contains the expanded cfusion.war file). Change the web-uri element for rds.war to rds-war. A directory name in the web-uri element cannot contain a dot.
- Save the application.xml file.
- Deploy ColdFusion 8 by copying the cfusion-ear directory structure to the jrun_root/servers/servername directory. If auto deploy is enabled, JRun 4 either deploys the application immediately (if the JRun server is running), or when you start the JRun server.
- Review the server log (jrun_root/logs/servername-event.log) to ensure that ColdFusion 8 deployed successfully.
When sandbox security is enabled in JBOSS. JBOSS startup java environment requires the policy file for it to start, otherwise an AccessControlException error is generated for everything and ColdFusion does not start.
To avoid this issue, edit run.sh and add the following parameters in the JVA_OPTS arguments
-Djava.security.manager
-Djava.security.policy="cf_root/WEB-INF/cfusion/lib/coldfusion.policy"
-Djava.security.auth.policy="cf_root/WEB-INF/cfusion/lib/neo_jaas.policy"
This document uses the following conventions:
- JBOSS_HOME
- Directory where JBoss is installed, for example, C:\jboss-4.0.5SP1 in Windows or /usr/local/jboss-4.0.5.SP1 on UNIX
- JBOSS_DEPLOY_DIR
- Application deployment directory in JBoss, for example, C:\jboss-4.0.5SP1\server\default\deploy
- CF_WEBAPP_ROOT
- Directory where ColdFusion is deployed, for example: C:\jboss-4.0.5SP1\server\default\deploy\cfusion.ear\cfusion.war
- TEMP_LOCATION
- Temporary location where you extract the cfusion.ear file.
Deploy ColdFusion on JBoss
- To ensure that ColdFusion can deploy on JBoss 4.0.5, perform the following steps instead of following the standard instructions in the cfmx-j2ee-readme.txt file:
- Keep periods in the directory names, instead of renaming them with dashes, for example, \deploy\cfusion.ear\cfusion.war.
- Do not make the updates to application.xml.
- Set JAVA_HOME to the appropriate JRE or JDK.
- Install ColdFusion by using the J2EE deployment option.
The installation program creates the cfusion.ear file in the install directory.
- Extract the cfusion.ear file to a temporary location.
The extraction operation generates cfusion.war rds.war and the META-INF directory files and puts them in the extracted folder.
- Extract the cfusion.war file to the TEMP_LOCATION\cfusion.ear\cfusion.war folder.
- Extract the rds.war file to the TEMP_LOCATION\cfusion.ear\rds.war folder.
- Copy the META-INF directory to the TEMP_LOCATION\cfusion.ear folder.
- Stop JBOSS if it is running.
- Copy the TEMP_LOCATION\cfusion.ear folder and its contents to JBOSS_DEPLOY_DIR.
- (Windows) Edit the JBOSS_HOME\bin\run.bat file by doing the following:
- If not present, add the JVM GC (-Xmx512m) parameter to JAVA_OPTS.
- Ensure that the permanent generation heap size is set by adding -XX:MaxPermSize=128m to JAVA_OPTS.
Without this parameter, the JVM can generate a java.lang.OutOfMemoryError error. For more information, see (http://wiki.jboss.org/wiki/Wiki.jsp?page=PermanentGeneration).
- Save the run.bat file.
- Start the server by running the JBOSS_HOME\bin\run.bat file.
- (Linux) Edit the JBOSS_HOME/bin/run.conf file by doing the following:
- In JAVA_OPTS, change -Xmx128m. to -Xmx512m.
- Add -XX:MaxPermSize=128m to JAVA_OPTS.
- Save the run.conf file.
- Start the server by running the JBOSS_HOME/bin/run.sh file.
To enable features with operating system-specific binaries, configure ColdFusion. This step is required to support the following features that use binaries that are specific to your operating system:
- CFX tags written in C++
- Microsoft Access driver with Unicode support (Windows only)
Use the following procedure for your operating system to configure the search paths to find the required binary files. These files are located in the CF_WEBAPP_ROOT\WEB-INF\cfusion\lib directory.
Configure operating system-specific binary support for Windows
- Ensure that JBoss Server is stopped.
- Edit JBOSS_HOME\bin\run.bat by adding the following:
set CF_LIB_PATH=CF_WEBAPP_ROOT\WEB-INF\cfusion\lib
set PATH=%PATH%;%CF_LIB_PATH%
- Save the file and start the server.
Note: You must copy the version of tools.jar that the application server uses to the cfusion/lib directory.
Configure operating system-specific binary support for Linux
- Ensure that JBoss Server is stopped.
- Edit JBOSS_HOME/bin/run.sh by adding the following:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:CF_WEBAPP_ROOT/WEB-INF/cfusion/lib
- Save the file and start the server.
Enable COM support (Windows only)
- Ensure that JBoss Server is stopped.
- Edit JBOSS_HOME\bin\run.bat by adding the following:
set CF_LIB_PATH=%CF_LIB_PATH%;CF_WEBAPP_ROOT\WEB-INF\cfusion\jintegra\bin;CF_WEBAPP_ROOT\WEB-INF\cfusion\jintegra\bin\international
- Save the file and start the server.
Enable communication with Flex
When ColdFusion is configured to use RMI for LiveCycle Data Services ES, ColdFusion listens on port 1099 by default. However JBoss typically starts listening on this port before ColdFusion does; as a result, an exception is thrown. To configure ColdFusion to use a different RMI port, on the Java and JVM page of the ColdFusion Administrator, specify the following in the JVM arguments text area:
-Dcoldfusion.rmiport=nnnn
Replace nnn
with the value of an unused port. If you try to connect from a LiveCycle Data Services ES server that is running in another JVM server to ColdFusion over RMI, the Flex server must start with the same JVM argument.
Disable RDS
- Stop ColdFusion.
- Edit JBOSS_DEPLOY_DIR\cfusion.ear\cfusion.war\WEB-INF\web.xml by commenting out the following:
<!-- <servlet id="macromedia_servlet_8789"> <servlet-name>RDSServlet</servlet-name> <display-name>RDS Servlet</display-name> <servlet-class>coldfusion.bootstrap.BootstrapServlet</servlet-class> <init-param id="InitParam_103401311065856789"> <param-name>servlet.class</param-name> <param-value>coldfusion.rds.RdsFrontEndServlet</param-value> </init-param> </servlet> -->
<!-- <servlet-mapping id="macromedia_mapping_9"> <servlet-name>RDSServlet</servlet-name> <url-pattern>/CFIDE/main/ide.cfm</url-pattern> </servlet-mapping> -->
- Save the file and start Coldfusion.
Some features, such as EJB3, require JRE 1.5. To use JRE 1.4, ensure that the jboss-aop-deployer pack is not installed as part of the JBoss installation. JBoss installs EJB3 if this pack is selected, which results in JBoss generating errors.