Introduction
Coldfusion MX 6.1 is advertised to run ontop of most major J2EE application servers. Whilst this is indeed true, it's simpler to run Coldfusion ontop of the pre-configured JRun server simply because there are a few configuration settings to be modified. For obvious reasons I was interested in seeing ColdFusion running ontop of Weblogic 8.1, but the configuration steps in the documentation where confusing (or even wrong in some cases), and this led to it being a longer exersize than I had planned. With this in mind I realised other people may have been put off of running Coldfusion on Weblogic 8.1, and therefore I've develop this step-by-step guide to installing it. It really IS simple and quick when the correct instructions are given!
I started developing this guide for both Linux and Windows, however I soon discovered that it was becoming very confusing. For that reason I've included two versions of this guide, one for Windows and one for Linux. One other point to note is that I've deliberately left out setting up the J2EE SecurityManager, I'll concentrate on this at a later date.
I'm not sure it matters, but these instructions where developed using the Developer edition of CFMX 6.1.
Installing ColdFusion
Before installing CFMX you need to make sure your logged in as root. I'm sure the installation will work even if your not, however I haven't tried it. You wil recieve a warning from the installation wizard if you are not the root user.
On Linux, there are two ways to install ColdFusion:
- Graphical: If your box is a workstation and has XWindows running on it, then you can use the graphical installer wizard, simply enter ./coldfusion-61-lin.bin -i swing.
- Console: If your box is a server and you don't have XWindows running on it, then simply enter ./coldfusion-61-lin.bin and the console installation wizard will run
During the installation you will be asked which type of installation you require. For Weblogic you should choose "Choose J2EE Configuration (EAR/WAR)" and then choose the WAR option that becomes highlighted. The rest of the installation can then progress as normal. For the rest of this guide I'll use the term <ColdFusion_Home> to refer to the installation directory.
Note
Since I'm running Gentoo Linux and not RedHat Linux, I received the following warning during the installation:
Pre-Installation Check: The installer was unable to determine if the C++ compatibility pack is installed by running the following command: rpm --query compat-libstdc++
If this machine uses a version of glibc that is 2.2.5.x or higher the compatibility pack is necessary for C++ custom tags, Verity, and web server connectors to work properly.
This was being thrown because Gentoo doesn't use RPM and thus the rpm command the installer is using returns nothing. I was able to carry on and install/run ColdFusion correctly, however I tried to find the elusive compatibility pack, but was unable to locate it. If you do require it then I think you'll have to talk to Macromedia Support.
Once the installation wizard has finished, there is one final step that you must complete. In order to use CFMX on Weblogic you must 'explode' the cfusion.war file. To explode the file follow these steps:
- Change directory to the installation directory, cd <COLDFUSION_HOME>
- Make a new directory called cfusion, mkdir cfusion
- Change to the cfusion directory, cd cfusion
- Now explode the cfusion.war file into this directory, jar -xvf ../cfusion.war
Creating a Domain
Creation of the Weblogic domain is done via the standard Weblogic Configuration Wizard:
- Start the wizard by running <BEA_HOME>/weblogic81/common/bin/config.sh
- Choose Create a new configuration and click Next
- Choose 'Basic Weblogic Server Domain' and click Next
- Choose Express configuration and click Next
- You will be asked to enter an administration user and password. Enter these in the usual way, but be careful to remember what your password as you can't get it back!
- Next select Development for the startup mode and SUN SDK for the JDK. It shouldn't matter which JDK you use (in fact JRockit should be faster) however I haven't tested CFMX on JRockit.
- On the last screen click browse in the bottom left hand corner and select a place where you will want to store your domains, something like /home/domains. Then select a configuration name, something like cfmx. Your actual domain configuration will be stored in a directory called /home/domains/cfmx.
- Click create and the configuration wizard will create your domain
Updating the startWeblogic.sh script
At this stage Weblogic is ready to run, however there's a few configuration settings that have to be added in order to support all the CFMX features. These settings are all added by editing the domains startWeblogic.sh script. The lines given below should be added just above the # Call WebLogic Server line at the bottom of your domains startWebLogic.sh file. Remember to change the <COLDFUSION_HOME> to your installation directory:
#******
#* START COLDFUSION Additions
#******
COLDFUSION_HOME=<COLDFUSION_HOME>
CLASSPATH="${CLASSPATH}:${COLDFUSION_HOME}/cfusion/WEB-INF/cfusion/lib"
# Add ColdFusion C++ support (ODBC, CFX etc)
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${COLDFUSION_HOME}/cfusion/WEB-INF/cfusion/lib
# Add Verity Support
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${COLDFUSION_HOME}/cfusion/WEB-INF/cfusion/lib/_ilnx21/bin
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${COLDFUSION_HOME}/cfusion/WEB-INF/cfusion/lib/_ilnx21/filters
# Add Charting Support
BOOT_CLASSPATH="-Xbootclasspath/a:${COLDFUSION_HOME}/cfusion/WEB-INF/cfusion/lib/webchartsJava2D.jar"
GRAPHIC_LIBS="-Djava.awt.graphicsenv=com.gp.java2d.ExHeadlessGraphicsEnvironment"
JAVA_OPTIONS="${BOOT_CLASSPATH} ${GRAPHIC_LIB} ${JAVA_OPTIONS}"
#******
#* END COLDFUSION Additions
#******
Starting the Domain
To start Weblogic run the startWebLogic.sh script in the domain directory with ./startWebLogic.sh. WebLogic will start and after a few seconds the line "Server started in RUNNING mode" will be displayed to show the server has started,
Adding Coldfusion to the domain
The last thing you need to do is add the ColdFusion engine to the WebLogic domain. This is done via the WebLogic console which can be viewed at URL http://localhost:7001/console. Login with the username and password you entered when configuring the domain
Deploying Coldfusion to your domain can then be done by doing the following:
- Expand the Deployments node in the left had tree
- Click on "Web Application Modules"
- In the right hand side click "Deploy New WebApplication Module"
- In the tree, locate the <COLDFUSION_HOME> directory
- Click on the coldfusion radio button and press "Target Module"
- On the next screen click "Deploy"
- ColdFusion will now be deployed to the server
Note
Whilst ColdFusion is being deployed to the server, you will see the following message:
"Public ID references the old version of the Servlet DTD. You must change the public ID in web.xml file to "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN".>"
Don't worry this is a known issue and won't effect the running of ColdFusion, it's simply a warning. This warning is described in the following TechNote http://www.macromedia.com/support/coldfusion/ts/documents/dtd_warning_bea.htm.
After a few seconds you'll see the message "Starting Logging..." appear in the servers console window. This is a message from ColdFusion, so if you see this, ColdFusion is running!
Enabling RDS
In order to enable ColdFusion RDS you need to deploy the RDS gateway to WebLogic, however, before this can be done, there are several configuration changes that need to be completed. The following instructions explain how to setup the gateway:

Logging into the Coldfusion Administration Console
Now everything should be setup correctly, it's time to log into the ColdFusion console and complete the setup. This can be done via the URL http://localhost:7001/cfusion/CFIDE/administrator
Checking Everything is ok
Once you've finished the standard CF Administrator setup you should be ready to go. The next stage is to check that all the optional parts are indeed working as expected.
- Testing Verity: You can check that Verity installed correctly by clicking on the "Verity K2 Server" option on the Admin menu. If all is configured correctly you should see the Verity configuration. If not you'll see a message saying that you need to enable Verity.
- Testing Charting: This can be done by running the graphing sample app: http://localhost:7001/cfusion/CFIDE/cfdocs/exampleapps/graphing1/index.cfm. If all is correct, you should see the graphs.
Trouble Shooting
There were a few issues I came across whilst building this tutorial, so I thought I'd list them here just incase anybody else hits them.
NullPointerException when accessing Administrator
When starting ColdFusion a NullPointerException is thrown straight away. I tracked this down to the fact that Weblogic requires the cfusion.war to be exploded!
"You must enable Verity" message in CF Administration console
The biggest issue was getting Verity just right. The console kept advising to 'enable' Verity and in the Exception log it kept reporting "Unsatsified Link Error: no cfindex.cfm in java.library.path". I tracked this down to the fact that I didn't have my LD_LIBRARY_PATH set correctly, and thus ColdFusion wasn't able to find the Verity binaries. (Java on Linux uses the LD_LIBRARY_PATH to populate the java.library.path system variable)
Conclusion
And that's it, ColdFusion running on Weblogic 8.1! In future articles I'll show you how to harness the power of Weblogic in your ColdFusion applications, but for now though, just take a deep breath and a well earned break!!
References
|