Adobe
製品
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
その他の製品一覧
ソリューション
デジタルマーケティング
デジタルメディア
教育
金融機関
Web Experience Management
その他のソリューション
ラーニング サポート ダウンロード 会社情報
ご購入
アドビストア 安心のサポート& サービス
アカデミックストア 学生、教職員、個人向け
アドビライセンスストア 中小企業向け
ボリュームライセンスについて 企業、教育機関、官公庁向け
販売パートナー
キャンペーン情報
検索
 
情報 サインイン
ようこそ、 さん カート 注文状況 マイアカウント
マイアカウント
注文状況
アカウント情報の変更
コミュニケーションの設定を変更
サインアウト
サインインの目的 お客様のアカウントや体験版ダウンロード、製品の拡張機能、コミュニティエリアへのアクセスなどを管理するため
Adobe
製品 セクション ご購入   検索  
ソリューション 会社情報
サポート ラーニング
サインイン サインアウト 注文状況 マイアカウント
先行予約の提供開始予定日Date. 商品が発送されるまで、クレジットカードには課金されません。提供開始の予定日は変更される場合があります。 先行予約の提供開始予定日Date. ダウンロードの準備が整うまで、クレジットカードには課金されません。提供開始の予定日は変更される場合があります。
個数:
ご購入には学生・教職員個人版の購入資格の確認が必要です。
小計
カートの中身を見る
Adobe Developer Connection / ColdFusionデベロッパーセンター /

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

ページ ツール

Facebookでシェア
Twitterでツイート
LinkedInでシェア
ブックマーク
印刷

タグ

必要条件

この記事に必要な予備知識

Knowledge of Eclipse IDE and ColdFusion administrator.

ユーザーレベル

中級

必要な製品

  • 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

  • ColdFusion 8 server monitoring – Part 3: Automated monitoring and request management with Alerts and Snapshots
  • Performance tuning for ColdFusion applications
  • 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
  • ColdFusion 8 server monitoring – Part 2: Using the Server Monitor in production
  • Adobe ColdFusion Builderベータ版スタートガイド
  • Taking advantage of 64-bit support in ColdFusion 8
  • ColdFusion 8 performance monitoring
  • What's new in ColdFusion Builder 2.0.1
  • HTML5 WebSockets and ColdFusion – Part 1: An overview and first steps

製品

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • モバイルアプリ
  • Photoshop
  • Touch Apps

ソリューション

  • デジタルマーケティング
  • コンテンツオーサリング
  • Web Experience Management

業種別ソリューション

  • 教育
  • 金融機関

サポート

  • ヘルプ&サポート
  • 注文と返品
  • ダウンロードに関するヘルプ
  • ユーザー登録に関するヘルプ

ラーニング

  • ADC: Adobe Developer Center
  • Adobe TV
  • Design Magazine
  • Photoshop Magazine
  • Focus In

ご購入方法

  • アドビストア
  • アカデミックストア
  • アドビライセンスストア
  • ボリュームライセンスについて
  • 販売パートナー
  • キャンペーン情報

ダウンロード

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

会社情報

  • プレスルーム
  • パートナープログラム
  • 企業の社会的責任(英語)
  • 採用情報
  • 投資家の皆様へ(英語)
  • イベント&セミナー
  • Legal(英語)
  • セキュリティ
  • お問い合わせ
国・地域および言語の選択 日本(変更)
国・地域および言語の選択 閉じる

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.

利用条件 | プライバシーポリシーとCookie (更新)

Reviewed by TRUSTe: site privacy statement