Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / ColdFusion Developer Center /

Using the ColdFusion 8 step-through debugger for Eclipse

by Brian Szoszorek

Brian Szoszorek
  • newpointmedia.com

Content

  • Installing the ColdFusion step-through debugger for Eclipse
  • Configuring ColdFusion to use the step-through debugger for Eclipse
  • Setting up Eclipse for ColdFusion debugging
  • Debugging against ColdFusion Server

Modified

30 July 2007

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
ColdFusion debugging performance

Requirements

Prerequisite knowledge

Knowledge of Eclipse IDE and ColdFusion administrator.

User level

Intermediate

Required products

  • ColdFusion 8 (Download trial)

Additional Requirements

Eclipse 3.2+

  • Learn More

ColdFusion 8 Extensions for Eclipse

  • Learn More

If you are a veteran ColdFusion programmer you may remember a little-known feature of ColdFusion 4.5 and 5. Before ColdFusion MX was redesigned to take advantage of the J2EE platform, ColdFusion Studio (the official ColdFusion IDE from Allaire Corporation) included a step-through debugger. In the early days of ColdFusion development, the step-through debugger was essential in identifying how your code was being executed.

The need for the code debugger was greatly diminished in ColdFusion 5 with the addition of the cfdump tag. The cfdump tag offered developers an simple way to debug variables at any stage of execution by displaying variables inline as HTML. Today, developers are defining the next generation of rich Internet applications with ColdFusion, Flex, and Ajax. Most of these service-based applications may never generate HTML at all; thus, you need something more than the cfdump tag for complex debugging.

Adobe ColdFusion 8 reintroduces step-through debugging with a free extension for Eclipse. Originally developed by IBM, the open-source Eclipse project offers developers the freedom to customize their development environment. Adobe Flex Builder 2 is also built on Eclipse, which means you can integrate the ColdFusion 8 step-through debugger directly into Flex Builder or into a stand-alone installation of Eclipse.

Step-through debugging allows you to place a breakpoint on any line of CFML code. Upon execution, ColdFusion will pause the request when it reaches the breakpoint and report the current values of the existing variables along with other diagnostic information. You can step through multiple breakpoints to analyze the request at different lines of execution.
Because step-through debugging is integrated directly into the ColdFusion 8 server, you may have multiple debug sessions running concurrently, a feature not supported by other third-party debugging tools for ColdFusion. Another feature of the ColdFusion 8 step-through debugger is the ability to trigger debug sessions from outside of the IDE. This means you can set a breakpoint in a CFC that is being called from a rich Internet application such as Adobe Flex, Adobe Flash, and Ajax applications. The ColdFusion debug session will be triggered when Adobe Flash Player calls the CFC and reaches the breakpoint. You can also debug CFCs called as web services regardless of where the request originated from.

In this article you will learn how to set up and use the new ColdFusion 8 step-through debugger for Eclipse, as well as learn how to set breakpoints and step though your code.

Installing the ColdFusion step-through debugger for Eclipse

Configuring ColdFusion to use the step-through debugger requires that you allow line debugging through the ColdFusion 8 Administrator; it may also be a good idea to enable a longer timeout limit for requests. To do so, use the following steps.

  1. Log in to your ColdFusion 8 Administrator and select Debugging & Logging > Debugger Settings.
  2. Select the Allow Line Debugging option. Click Submit Changes (see Figure 1).

To install the ColdFusion Eclipse Extensions (download these from the Requirements section. Once you have downloaded the extensions, use the following steps to install them.

  1. Open Eclipse.
  2. Select Help > Software Updates > Find and Install.
  3. Select the Search for New Features to Install option.
  4. Click New Archived Site.
  5. Browse to the file CF8-Extensions-for-Eclipse.zip. Click Open.

    Note: If you installed ColdFusion 8 with the default setup, there is a folder under c:\coldfusion8\extras that contains this file.

  6. Select the CF8-Extensions-for-Eclipse.zip and click Next.
  7. Accept the License Agreement and click Next.
  8. Click Finish and select the option to install all.
  9. After the installation is completes, restart Eclipse or Adobe Flex Builder, whichever you happen to be using.

Configuring ColdFusion to use the step-through debugger for Eclipse

Configuring ColdFusion to use the step-through debugger requires that you allow line debugging through the ColdFusion 8 Administrator; it may also be a good idea to enable a longer timeout limit for requests. To do so, use the following steps.

  1. Log in to your ColdFusion 8 Administrator and select Debugging & Logging > Debugger Settings.
  2. Select the Allow Line Debugging option. Click Submit Changes (see Figure 1).
Enabling the Allow Line Debugging option
Figure 1. Enabling the Allow Line Debugging option
  1. It may be a good idea to enable a longer timeout limit for requests. The reason for allowing the longer timeout is that when the step-though debugger stops at a breakpoint, the request is held open with the ColdFusion server. You may want to specify a time period longer then 60 seconds while you are evaluating the debug output before the request times out. To enable timeout limits for requests, use the following steps:
    1. Select Server Settings > Settings.
    2. Select the Timeout Requests option and set it to 300 seconds; then click Submit (see Figure 2).
Figure 02
Figure 2. Resetting the Timeout Requests limit
    1. Restart ColdFusion.

Note: Running a ColdFusion server in Debug mode in a production environment is not recommended as a best practice. However, since ColdFusion 8 supports multiple debug sessions, you are able to debug in production without hindering application availability. This is an important benefit as third-party debugging tools for ColdFusion only allow one debug session at a time.

Setting up Eclipse for ColdFusion debugging

Now you have to tell Eclipse where your ColdFusion server is located. You have the ability to add as many servers as you wish. They can be local (your machine) or a remote server(s). The servers against which you wish to debug must all have debugging enabled, and you must have RDS access as well.

  1. With Eclipse open, select Window > Preferences.
  2. In the tree menu select the RDS Configuration option (see Figure 3).
  3. Enter any description you wish.
  4. If your ColdFusion server is running locally, enter 127.0.0.1 for the Host Name.
  5. If you installed ColdFusion in a stand-alone configuration, enter 8500 for the port number of the server.

    Note: If you installed ColdFusion in multiserver configuration locally with JRun, your default ColdFusion instance port will be 8300.

  6. Enter the username and password you created when installing ColdFusion 8.
  7. Click the Test Connection button. See the dialog box in Figure 4 showing that Eclipse can connect to your ColdFusion server.
Selecting RDS Configuration
Figure 3. Selecting RDS Configuration
A successful Eclipse connection to your ColdFusion server
Figure 4. A successful Eclipse connection to your ColdFusion server

Now that you have connected to your ColdFusion 8 server, you can view the defined data sources and browse database tables, view all CFCs available to you, and take advantage of the ColdFusion wizards for rapid application development.

Debugging against ColdFusion Server

Now you have to set up the ColdFusion server you wish to debug code against. In the menu at the top of the Eclipse editor you will see a debug icon that looks like a small bug (see Figure 5).

The Debug icon
Figure 5. The Debug icon
  1. Click the down arrow next to the debug icon and select "Debug" (see Figure 6).
Selecting Debug mode
Figure 6. Selecting Debug mode
  1. Select ColdFusion Application. Next, click the New Launch Configuration button (see Figure 7).
Selecting a new launch configuration for a ColdFusion application
Figure 7. Selecting a new launch configuration for a ColdFusion application
  1. Enter a name for your ColdFusion server (see Figure 8). Set the debug homepage URL to http://localhost:8500 if you are running ColdFusion in the stand-alone configuration, or http://localhost:8300 for the default ColdFusion multiple server instance configuration.
  2. Click Apply and then click Debug.
Naming your ColdFusion Server
Figure 8. Naming your ColdFusion Server

If Eclipse did not switch or ask you to switch to the debug view, use the following steps:

  1. Select Window > Open Perspective > Other.
  2. Select Debug and click OK.

You should now be in the Debug perspective and see the following in the Debug window (see Figure 9).

Your local ColdFusion Server in the Eclipse Debug window
Figure 9. Your local ColdFusion Server in the Eclipse Debug window

See that Eclipse is connected to your ColdFusion server. If it isn't, click the down arrow next to the debug button, and then click the name of the debug setting you gave when you set up the debug mappings (see Figure 8).

Now, you will test the debugger by writing some code and setting breakpoints.

  1. Put a file on the root of your ColdFusion server.
  2. Enter some test code such as the following:
<cfset message = "Hello World!"><br /> <cfset message = "Hi!"><br /> <cfset session.myName = "Brian"/> <cfset a = arraynew(1)><br /> <cfset a[1] = "Slot 1"><br /> <cfset a[2] = "Slot 2"><br /> <cfset a[3] = "Slot 3"><br /> <cfset a[4] = "Slot 4"><br /> <cfset session.slots = a/> <cfloop from="1" to="#arrayLen(a)#" index="i"/> <cfset item = a[i]/> </cfloop/>
  1. Double-click or right-click next to a line of code, and then select "Toggle breakpoint" (see Figure 10). This halts processing at the line, enabling you to inspect variables at that point in the processing of your ColdFusion template. A small blue dot will appear on each line you set a breakpoint to. To remove a breakpoint, simply double-click the breakpoint dot.
Toggling a breakpoint
Figure 10. Toggling a breakpoint
  1. Browse to the file you just created. In your Eclipse Debug perspective, in the Variables view, you will see output like that shown in Figure 11 when the breakpoint is hit. Here you see all variables that have been created up to the breakpoint you set.
Variables created up to the breakpoint
Figure 11. Variables created up to the breakpoint
  1. If you wish to see more variables than just the local variables, request variables, and argument variables, you must enable additional scopes:

  1. Select Window > Preferences.
  2. In the tree on the left side, expand the ColdFusion node and select Debug Settings. See the screen shown in Figure 12.
The Eclipse Debug Settings screen
Figure 12. The Eclipse Debug Settings screen

After enabling more scopes for inspection, run your code again to see the changes. Figure 13 shows an example Variables view after enabling the application, server, and session scopes.

The Variables view at the breakpoint with the application, server, and session scopes enabled
Figure 13. The Variables view at the breakpoint with the application, server, and session scopes enabled

In the top of your Debug view (see Figure 14) you will see the following icons that enable you to control how the debugger steps through the code.

Debug control icons in the top of the Debug view.
Figure 14. Debug control icons in the top of the Debug view.

icon 1

Clicking this icon resumes processing, meaning the application will continue to run until the request is completed or reaches another breakpoint that you have set in your code.

icon 2

During debugging you can click this icon to terminate the debugging session.

icon 3

This icon steps into the code after you have hit a breakpoint. It will execute subsequent code line by line, and the changes to your application's variables will be reflected in the Variables view. Using step-into will debug line by line any CFCs, UDFs, or includes and the like.

icon 4

This icon is the step-over icon. Just like the step-into icon, it processes subsequent code line by line; however, it will exclude CFCs, UDFs, includes, and the like.

Conclusion

Now that you are all hooked up, you can easily use the step-though debugger to get important insight into how your ColdFusion applications are executing.

With everything configured, the next time you start Eclipse, your settings will be in place so that you can start debugging your ColdFusion code right away.

More Like This

  • Performance tuning for ColdFusion applications
  • Getting started with Adobe ColdFusion Builder 2
  • ColdFusion 8 server monitoring – Part 2: Using the Server Monitor in production
  • ColdFusion 8 server monitoring – Part 4: Multiserver Monitor, Admin API monitoring, and more
  • ColdFusion 8 server monitoring – Part 1: Using the Server Monitor in development
  • Taking advantage of 64-bit support in ColdFusion 8
  • ColdFusion 8 performance monitoring
  • ColdFusion 8 server monitoring – Part 3: Automated monitoring and request management with Alerts and Snapshots
  • Working with Tomcat as the built-in application server
  • What's new in ColdFusion Builder 2.0.1

Tutorials & Samples

Tutorials

  • Using Axis2 web services with ColdFusion 10
  • Serving HTML5 videos with ColdFusion 10
  • HTML5 WebSockets and ColdFusion -- Part 2

Samples

ColdFusion Blogs

More
07/06/2012 Adobe ColdFusion 10 on CIO.com
06/22/2012 Elishia Dvorak Joins as ColdFusion Solution Consultant and Product Evangelist
06/19/2012 Outstanding contributions to the ColdFusion 10 and ColdFusion Builder 2.0.1 pre-release
06/18/2012 CF html to pdf service - consume from node.js using rest api

ColdFusion Cookbooks

More
04/01/2012 Send multiple mails with the adresses from database
07/27/2011 Passing a list with with STRING values
05/27/2011 AUTOMATED SANITIZED Resultset with ColdFusion
03/16/2011 Using Metadata To Add Static Variables to ColdFusion Components

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement