Before you can use the Debugger, enable debugging in the ColdFusion Administrator.
- In the ColdFusion Administrator, select Debugging & Logging > Debugger Settings.
- Enable the Allow Line Debugging option.
- Specify the port to use for debugging if different from the default that appears.
- Specify the maximum number of simultaneous debug session if different from the default.
- Click Submit Changes.
- You may have to increase the time after which requests time-out by doing the following:
- Select Server Settings > Settings.
- Enable the Timeout Requests After (Seconds) option.
- Enter 300 or other appropriate number in the text box.
The debugger server listens for commands from the Eclipse client from a separate port from the one specified in step 3. By default, ColdFusion launches the debugger server with a random available port. This could be a problem if ColdFusion (and hence debugger server) is behind a firewall and the firewall blocks the random port that the debugger is listening.. To prevent this problem, you can specify a fixed debugger server port number and allow this port in the firewall. To set a fixed debugger server port number, specify the following JVM argument on the Java and JVM page of the ColdFusion Administrator (or the appropriate place for your JEE Application Server), replacing portNumber with the port you want to use:
- Restart ColdFusion. If you are running the JEE configuration of ColdFusion, restart the server in debug mode with the debug port as specified.
To modify the debug settings, in Eclipse, select Window > Preferences > ColdFusion > Debug Settings. You can specify the home page URL, which points to the page that appears in the Debug Output Buffer of the debugger when you click the Home button. You can also specify the extensions of the types of files that you can debug and variable scopes that you want the Debugger to recognize. To improve performance when debugging large files, deselect all scopes for which you do not require information.
Note: To ensure that the debugger stops in the template you are debugging on the line that causes a ColdFusion error, select Preferences > ColdFusion > Debug Settings and select the Enable Robust Exception Information checkbox.
- To configure an RDS server, in Eclipse, select Window > Preferences > ColdFusion > RDS Configuration.If you are running ColdFusion on the same computer as Eclipse, localhost is configured by default. To use any additional RDS servers, enter the configuration information.
If ColdFusion and Eclipse are not running on the same computer, in Eclipse, select Window > Preferences > ColdFusion > Debug Mappings. Then specify the path that Eclipse uses to open files on the ColdFusion server and the path that ColdFusion uses to find the files that you are editing in Eclipse.Mapping ensures that Eclipse and ColdFusion are working on the same file. For example, if you are editing files in an Eclipse project that points to D:\MyCoolApp. Then, when you deploy the files to the ColdFusion server, you copy them to W:\websites\MyCoolSite\, which the ColdFusion server recognizes as D:\Shared\websites\MyCoolSite. The mapping in Eclipse specifies that the Eclipse directory is D:\MyCoolApp and the server is D:\Shared\websites\MyCoolSite. Eclipse translates the file path (D:\MyCoolApp\index.cfm) to a path that the ColdFusion server recognizes (D:\Shared\websites\MyCoolSite\index.cfm). To see more information about the interaction between the client and the server, add the following to the JVM arguments in the ColdFusion Administrator:
If you are not running the server configuration of ColdFusion, specify Java debugging parameters in the configuration file or startup script of the application server you are running. The parameters should look like the following:
Ensure that the port number you specify is the same port number specified on the Debugger Settings page of ColdFusion Administrator.If you are running the server configuration, ColdFusion writes these debugging parameters to the jvm.config file when you use the Debugger Settings page of the ColdFusion Administrator.
- If you are not running the server configuration and your application server is not running on JRE 1.6, copy the tools.jar file of the JDK version that your application server is running to the \lib folder of ColdFusion. For example, if you are running JRun that runs on JRE 1.4, copy the tools.jar file of JDK 1.4 to the \lib folder of ColdFusion.
- If you are running the server version of ColdFusion and you specify a JRE version other than JRE 1.6 in the jvm.config file, copy the tools.jar file of the JDK version specified in your jvm.config file to the \lib folder of ColdFusion.
Test and modify the debugger in Eclipse
You can determine whether the Debugger server is configured correctly in Eclipse by selecting Window > Preferences > ColdFusion > RDS Configuration, and then clicking Test Debugger.
You can modify RDS configurations easily from the RDS Fileview or RDS Dataview by clicking the Edit RDS Preferences button in the view.