Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
One downside of working with Web applications is the general lack of line-based debugging tools. ColdFusion 8 introduced line debugging with the plug-in for CF Eclipse and the same debugging tool as part of ColdFusion Builder. In order to use debugging in CF Builder, you have to first enable the debugger inside of the ColdFusion server. To do that, we'll right-click on our server in the Servers view and choose Launch Admin Page. This will launch the ColdFusion Administrator and we'll log in and on the bottom left-hand side, click Debugging & Logging and Debugger Settings.
Now, we only have a few options here. The first is to actually Allow Line Debugging. The second is the port that the debugger is going to run on and the last is how many simultaneous debugging sessions ColdFusion server should support. The thing to note here is to make sure that your debugger port is not already in use by another process or service on your system. If it is in use then the ColdFusion server will not start successfully. To find out if this port is in use, on the Mac, we'll go to a Terminal window or on Windows, open up a command prompt and type netstat.
On Windows, you'll type -a or on the Mac, -anf inet. Press Enter and you'll see all the other ports that are currently in use on your system. If I scroll up here to the top, I can see the port 8500 is in use, my ColdFusion server is running on that port, but nowhere on this list do I see port 5005. So, in my case, the default port of 5005 is available. If you do see 5005 in use here, you'll need to choose another port 5006 or 5007 as an example that is not in use.
So, I'll go back to the ColdFusion Administrator and click Submit Changes and then I'll get the exact same warning that I just gave you, which is to make sure that your debugger port is not already in use. The next thing I need to do is to actually restart ColdFusion so that the debugger can become enabled. So, we'll close the Administrator and in Servers view, I'll right-click on my server and click Restart. After the server is restarted, I can go back to my Servers view. We'll go back into the ColdFusion Administrator and on my Debugger Settings page, I'll click Start Debugger Server.
I'll now have the option to stop the debugger or to restart it if for whatever reason something isn't working properly. So, we're done inside the ColdFusion Administrator. I'll close that. The next thing we need to check is that our project is actually associated with the proper server to start debugging. So, I'll right-click on my project and choose Properties. Then in the ColdFusion Server Settings, I'll need to make sure that I specify my Local CF9 server so that it's associated with that project. Click OK and the last thing we need to do is set up a debug configuration. I'll click on the little arrow next to my bug in the toolbar and then choose debug configurations.
Depending on the setup on your local machine, the CFCs displayed may differ from those shown here. Since I'm debugging a ColdFusion application, I'll select ColdFusion Application and click the New icon. This allows me to create a new launch configuration for my CF Builder project. So, I'll give it a name, CFBuilderDebugging. Make sure to use your own FTP information when setting up the connection. I'll click Apply and then Debug. This will then ask me if I want to switch to the Debug perspective. I'll click Yes.
If you see a screen asking you to associate CFM and CFC files, check the box to make CF Builder the default application to open when a ColdFusion file is double-clicked. And it actually give me two different prompts. In this case, I'll say Remember my decision, so that the next time I open the debugger, it'll automatically switch me to the ColdFusion Debugging perspective. Click Yes again. Now that we have the debugger turned on, on the ColdFusion server, we've created a launch configuration in CF Builder and we're in the debugging perspective, we can now start debugging some ColdFusion code.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 100051 Viewers
56 Video lessons · 113110 Viewers
71 Video lessons · 81964 Viewers
131 Video lessons · 39323 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.