How to display a customized error message when the web server cannot communicate with ColdFusion MX
If there is a problem preventing communication between your web server and Macromedia ColdFusion MX, a default error message will be returned to the browser. This TechNote describes how to use theerrorurl setting to display a customized error handler page instead of the default error. This technique applies to ColdFusion MX Server configuration, or ColdFusion MX for J2EE on JRun.
If the ColdFusion server is not running or if there is a problem preventing communication between your web server and ColdFusion, one of the following errors is displayed in a browser when requesting a ColdFusion page:
Server Error The server encountered an internal error and was unable to complete your request. Could not connect to JRun Server.
Server Error The server encountered an internal error and was unable to complete your request. Application server is busy. Either there are too many concurrent requests or the server still is starting up.
Instead of showing this error, you may want to display a customized error message more consistent with the look and feel of your application. To redirect requests to an error handling HTML page, use the steps below to modify the errorurl setting in the configuration file for the web server connector.
IIS
Modify the jrun.ini file located in the appropriate subdirectory under the cf_root\runtime\lib\wsconfig\ directory. Uncomment the errorurl line by removing the pound sign. Note that if you have more than one web server configured for use with ColdFusion, each web server will have its own numbered configuration directory.
For example:
verbose=false scriptpath=/JRunScripts/jrun.dll serverstore=C:/CFusionMX/runtime/lib/wsconfig/2/jrunserver.store bootstrap=127.0.0.1:51010 apialloc=false ssl=false ignoresuffixmap=trueerrorurl=http://localhost/ErrorHandler.htm
You are responsible for creating the errorHandler.htm page, which displays a site-specific message to the user. You must restart your web server after making this change.
Apache
Modify the JRun Settings section in the Apache httpd.conf file, uncommenting the Errorurl setting by removing the pound sign.
For example:
# JRun Settings LoadModule jrun_module "C:/CFusionMX/runtime/lib/wsconfig/2/mod_jrun20.so"<IfModule mod_jrun20.c> JRunConfig Verbose false JRunConfig Apialloc false JRunConfig Ssl false JRunConfig Ignoresuffixmap true JRunConfig Serverstore "C:/CFusionMX/runtime/lib/wsconfig/2/jrunserver.store" JRunConfig Bootstrap 127.0.0.1:51010JRunConfig Errorurl http://localhost/ErrorHandler.htm AddHandler jrun-handler .cfm .cfc .cfml .jws</IfModule>
iPlanet 6
Add the errorurl setting to the end of the jruninit setting in the Magnus.conf file.
For example:
Init fn="load-modules" shlib="C:/CFusionMX/runtime/lib/wsconfig/3/jrun_nsapi35.dll" funcs="jruninit,jrunfilter,jrunservice" Init fn="jruninit" serverstore="C:/CFusionMX/runtime/lib/wsconfig/3/jrunserver.store" bootstrap="127.0.0.1:51010" verbose="false" apialloc="false" ssl="false" ignoresuffixmap="false"errorurl="http://localhost/ErrorHandler.htm"
iPlanet 4
Add the errorurl setting to the end of the jruninit setting in the Obj.conf file.
For example:
Init fn="load-modules" shlib="C:/CFusionMX/runtime/lib/wsconfig/3/jrun_nsapi35.dll" funcs="jruninit,jrunfilter,jrunservice" Init fn="jruninit" serverstore="C:/CFusionMX/runtime/lib/wsconfig/3/jrunserver.store" bootstrap="127.0.0.1:51010" verbose="false" apialloc="false" ssl="false" ignoresuffixmap="false" errorurl="http://localhost/ErrorHandler.htm"
Additional Information
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
