Solving MS SQL "connection refused" Errors and running MS SQL on a MacBook Pro

Posted At : November 14, 2006 11:51 AM | Posted By : Mark Drew
Related Categories: coldfusion, microsoft, reference, apple

I did a fresh install of Windows with ColdFusion 7.02 and MS SQL 2000 (SP2?) under Parallels on my MacBook Pro the other day. After I had installed everything I tried to set up a DSN in ColdFusion but I kept getting "connection refused" errors, no matter what I did. I did a lot of googling to find a solution and found lots of work arounds including setting up a ODBC data-source. None of these were satisfying, I mean, you SHOULD be able to connect to a database right? That's the whole point!

So that I don't do the same mistake again I thought I would blog it. The solution is actually rather simple, you just have to install Microsoft SQL Server 2000 Service Pack 3a. That totally solves the problem. (I haven't checked with upgrading to Service Pack 4 yet.)

On a related note, I was able to connect to the Microsoft SQL Server running under Parallels from OS X. Pretty neat!

CFEclipse coding Part 2: The Plugin.xml file

Posted At : November 7, 2006 6:59 PM | Posted By : Mark Drew
Related Categories: cfeclipse, reference

The plugin.xml file is the basis of your Eclipse plug-in. If you open this file using the Plug-in Manifest Editor you will get a nice graphic interface to the underlying files. This is definitely much easier than editing by hand.

When you open the editor, at the bottom you will be able to see eight tabs:

Overview - This provides an overview of the plugin, the version number, the plugin provider and links to the different editor pages.

Dependencies - lists the plugin-ins that are required for CFEclipse to run (such as: org.eclipse.ui, org.eclipse.jface.text etc)

Runtime - lists the libraries (.jar files basically) that are required for CFEclipse to run, including the plugin itself.

Extensions - this editor lists the contributions that the plugin-makes to the platform, in other words, actions that this plug-in will add to the base eclipse, here you will have actions, toolbars, views, editors etc. This is the core of adding new actions to CFEclipse.

Extension Points - declares new function points that this plugin-in adds to the platform, i.e. things that other plugins that require cfeclipse can use.

Build - this defines what gets exported to the plugin, you have a binary build (what most people download and install as a plugin) and the source build that could include all the source code if we were sending this out too.

It also defines what the runtime jars will be and any other libraries that are just required at runtime.

plugin.xml - the raw XML of the plugin.xml file, if you need to make modifications or just do some cut and paste jobs.

build.properties - this is the file that is generated by the Build page.

In the next topic, I shall go off and explain some of the Extension points and get down and dirty with some Java... bet you cant wait eh?

Getting started with the CFEclipse code

Posted At : November 7, 2006 6:15 PM | Posted By : Mark Drew
Related Categories: cfeclipse, reference

I just got an email from Robert Munn, he managed to check out the branch code for CFEclipse (you can have a look at it here ) and he asked where does one start? There is a lot of code and a few folders etc... so I thought I would start doing some posts describing how the code is organised and what goes where. When you first download the source if you have followed the documentation you should get a bunch of folders and files at the root of your application.

dictionary This is where all the language dictionaries go. They are XML definition files for each language version such as CF5-> CFMX7 as well as HTML, JavaScript and SQL (more on this on a later post
doc Help Documentation
icons Image files used for icons and buttons
intro (Product Version) When we do a Product Version (standalone) this is the folder where all the help docs will go
lib Where any other Java JAR libraries that are required are stored (such as Log4J etc)
readme Any readme files to go here. might be an idea for people to put descriptions of changes here!
schema Extension schemas so that other plugins can use CFEclipse, underused and will be used more in the future
snippets Additional snippet code base, we used to have a build for you to install pre-made snippets, and here they are, all pre-made for you
src This is where the actual Java code goes! The real stuff.
.classpath This file actually contains the paths to extra libraries that are used by CFEclipse
.project This is an Eclipse generated file, defines the project by name etc... you would probably overwrite this at any rate if you get errors about external builders
build.properties Used by Eclipse to define what to package up when its building the plugin, dont need to edit directly (see plugin.xml)
cfeclipse.product (Product Version) Central file to define a standalone build of CFEclipse (like the standalone version of FlexBuilder)
License.txt Does what it says on the tin. What did you expect? Shakespeare?
plugin.properties These are the externalisation of text strings from the plugin.xml file so we can be multi-lingual in the future
plugin.xml This is the core file of any plugin, open this in the Plug-in Manifest Editor, and you get a very good breakdown of what it does and how you can add features. This deserves its own post which I shall put up later
plugin_customization.ini (Product Version) This file puts some default settings like which perspective you want the product to start with
splash.bmp (Product Version) The startup splash screen for the product version

I hope this helps people get a bearing on what the whole plugin is about. I shall post more info later on the plugin.xml file as that is a very important file and the basis of your plugin.

Getting your hands on the CFEclipse code

Posted At : November 6, 2006 2:15 PM | Posted By : Mark Drew
Related Categories: cfeclipse, reference

I have just been looking at the documentation on the current cfeclipse.org site, and its very out of date, we have moved our code base from using CVS to using SVN so we could host it ourselves and use Trac rather than depending on Tigris.

Tracy Logan has kindly helped the CFEclipse project in two ways and he deserves much kudos, firstly by fixing the CFC Wizard and putting the right arguments in the tag when it is created, and secondly by writing some instructions on how you can check out the CFEclipse codebase into a project. You can read the article over at CFEclipse.org

I shall try (I promise!) to make a few articles explaining some of the code behind CFEclipse, although having said that we are in the process (thanks to Mike Kelp) of breaking out some of the functionality into their own libraries. The first part will be the CFParser, which just checks if the code is correct and throws any errors and warnings. This will mean that we can perform unit tests that are not related to Eclipse itself, meaning in the future (sometime!) people could run their CF code through the parser as part of an online library of unit tests, and we can assign people to fix that.

Let me know your thoughts!

EDIT: if you want to see the latest code, check out the 1.3 dev branch... which is what the 1.3 BETA is based on.

Install ColdFusion MX on MacBook (Pro) and Intel based Macs

Posted At : July 27, 2006 6:36 AM | Posted By : Mark Drew
Related Categories: coldfusion, reference, apple

Mark Andrachek has posted a great walkthrough on how to finally install ColdFusion on your brand new spanking MacBooks and Intel based Macs

The main part that had stumped me was building the Apache Connector to Jrun but he pointed out that you had to download the JRun OEM SDK to get the connector to compile.

He has a full guide that I shall try out later on today!

A pointer for people out there, Verity DOES NOT WORK since it is not supported on OS X

Coldfusion handling Java null's

Posted At : July 12, 2006 5:28 PM | Posted By : Mark Drew
Related Categories: coldfusion, Java, reference, webdev

I have been reading a number of posts how to handle nulls in Coldfusion. Coldfusion doesnt naturally handle a "null" object returned from Java (as far as I can see, I have read a few posts and still no definate answer, so here goes for a couple of tips, just to keep myself sane and to remind myself.

There are two ways that you can handle a null and it depends what the returned object is, firstly lets handle nulls where the returned object might be something simple like a number or a string, the easiest method would be to simplify the variable, so you can trim the result, if it is null, you will get an empty string:

<cfset myString = CreateObject("java", "com.some.Class").init().getName()>

<cfif Len(myString)>
#myString#
</cfif>

The second method is used if you return complex data, such as an Array, Structure or Java Objects themselves:

<cfset UsersArray = CreateObject("java", "com.some.Class").init().getUsers()>

<cfif isDefined("UsersArray")>
<cfdump var="#UsersArray#">
</cfif>

If someone has a better method of managing returned nulls from Java, please let me know and I can update this post.

Installing Coldfusion (and JRun) on a MacBook Pro

Posted At : April 12, 2006 4:39 PM | Posted By : Mark Drew
Related Categories: coldfusion, reference, apple

I didnt have that many problems doing this installation but a number of people have asked me about this, both here and on Sean Corfield's blog.

So I have gone through the process and taken pictures along the way so you can work with me :)

Check out the Gallery here
Remember that there is more info on deploying Coldfusion on JRun over at Macromedia