D A V I D M A D D I S O N
Installing CFMX 6.1 on WebLogic 8.1 (Windows)

Introduction

Coldfusion MX 6.1 is advertised to run on top of most major J2EE application servers. Whilst this is indeed true, it's simpler to run Coldfusion on top 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 on top 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 exercise than I had planned. With this in mind I realized 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. These instructions assume no knowledge of Weblogic 8.1. If your familiar with Weblogic you should be able to skip through these steps quickly

Installing ColdFusion

To start the Installation simply run the coldfusion-61-win.exe file as normal.

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.

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 choosing the Start -> BEA Weblogic Platform 8.1 -> Configuration Wizard
  • 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 yet]
  • 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 c:\domains. Then select a configuration name, something like cfmx. [In this case your actual domain configuration will be stored in a directory called c:\domains\cfmx]
  • Click create and the configuration wizard will create your domain

Updating the startWeblogic.cmd 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.cmd script. The lines given below should be added just above the @REM Set SERVER_NAME line at the bottom of your domains startWebLogic.cmd file. Remember to change the <COLDFUSION_HOME> to your installation directory:

@REM **********
@REM * START COLDFUSION ADDITIONS
@REM **********
set COLDFUSION_HOME=<:COLDFUSION_HOME>
set CLASSPATH=%CLASSPATH%;%COLDFUSION_HOME%\cfusion\WEB-INF\lib

@REM Add COLDFUSION C++ support
set PATH=%PATH%;%COLDFUSION_HOME%\cfusion\WEB-INF\cfusion\lib

@REM Add COLDFUSION Verity Support
set PATH=%PATH%;%COLDFUSION_HOME%\cfusion\WEB-INF\cfusion\lib\_nti40\bin
set PATH=%PATH%;%COLDFUSION_HOME%\cfusion\WEB-INF\cfusion\lib\_nti40\filters

@REM **********
@REM * END COLDFUSION ADDITIONS
@REM **********

Starting the Domain

To start Weblogic run the startWebLogic.cmd script in the domain directory. Weblogic will start and after a few seconds the line "Server started in RUNNING mode" will be displayed to show the server has started.

Enabling COM Support

If you try and use a COM object using the <CFOBJECT tag, a JIntegra License Exception will be thrown. This is because Weblogic 8.1 already has a COM engine integrated into it (called jCOM), and this is conflicting with the COM engine inside ColdFusion. The workaround for this issue is to use the Weblogic COM engine, which by default isn't enabled.

To enable COM support on Weblogic 8.1 follow these steps:

  • In the Weblogic console (http://localhost:7001/console), click on myserver in the left hand tree
  • In the right hand panel click on the protocols tab and then on the jCOM tab
  • Click the "Enable COM" check box
  • Also click the "Enable Native Mode" and "Prefetch Enumumeration" check boxes
  • Click apply and restart your Weblogic server

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 the 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 as follows:

  • 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 cfusion 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 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:

  • Change directory to <COLDFUSION_HOME>
  • Make new directory called RDS, mkdir rds
  • Change directory to the new rds directory, cd rds
  • And explode the rds.war file into this directory, jar -xvf ..\rds.war
  • Change directory to WEB-INF, cd WEB-INF
  • Open notepad to create a new file called weblogic.xml
  • In this file enter the following:
    <!DOCTYPE weblogic-web-app PUBLIC 
    "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" 
    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
    <weblogic-web-app> 
         <context-root>/CFIDE</context-root> 
    </weblogic-web-app>
  • Save the file and close Notepad
  • Open up the WebLogic administration console, http://localhost:7001/console
  • And deploy the rds application the same way you did the cfusion application, see Adding Coldfusion to the domain.

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 PATH set correctly, and thus ColdFusion wasn't able to find the Verity binaries

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. For now though, take a deep breath and a well earned break!

References


Comments:

Post a comment:
Name: *
email: *
url:
Comment
 
 
- BEA Weblogic Workshop
- ColdFusion
- Flex
- Other Stuff
 
- BEA Workshop
- FREE Workshop Licenses

- Macromedia Flex
- Macromedia ColdFusion

- UK CFUG Blog Aggregator