Tech Blog

Tag: ColdFusion

CFPRINT Tag -New in Scorpio (ColdFusion 8)

by Rolando on Jun.01, 2007, under ColdFusion

Ben Forta mentioned a couple of days a go a new tag introduced with Scorpio, called CFPRINT.  If you don’t run Intranet applications this tag might not be of your interest, however if you do, you might need to perform tasks such as printing nightly sales reports, monthly inventory reports or just print customer’s orders as they come in.  CFPRINT automates this process for you, so that now human intervention is needed or hacks.

The ColdFusion service must be running under a user with rights to print through the Network or Local computer depending on your setup.  Remember this will work as long as you have your printer available to your Local Network where the CF Server resides.  This means that if you have multiple locations for your business and have a remote printer available to your local network you should be able to print then to that remote location.  This is great if you receive all your orders in a central location but then redistribute those depending on the proximity of the customer or just depending on inventory availability, etc.

You can see a list of all available printers through the ColdFusion Administrator.  Ben also mentioned in his post a new function that came along with the CFPRINT tag, called GetPrinterInfo().  As the name suggests this will return information pertinent to the requested printer.

You can read Ben’s Post here

Leave a Comment : more...

Connecting PostgreSQL 8.1 & ColdFusion MX 7

by Rolando on May.24, 2007, under ColdFusion

So far ColdFusion does not have a default driver to connect to a PostgreSQL Database. However you can manually create a connection using a JDBC driver.

  1. Download the JDBC driver http://jdbc.postgresql.org/ You need to know what is your JDK version so that you can select the proper driver. To check your JDK version open Terminal and type:
    java --version
    In my case I have "1.4.2", therefore I downloaded JDBC 3 for PostgreSQL 8.1
  2. Copy the driver (jar file) to your coldfusion location at:
    [cfRootFolder]/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib
    in my case this was:
    /opt/jrun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib
  3. Restart ColdFusion:
    cd into /opt/jrun4/bin/ and type:
    ./jrun -restart

NOTE: for some reason when

I execute this command it my system won't complete the restart process so I had to do a Stop and Start like ./jrun -stop and then ./jrun -start

  1. Now go to your ColdFusion admin add a new Data Source of type "Other"
  2. Enter your JDBC URL as: jdbc:postgresql://localhost/[your database name]
  3. Set Driver Class and Driver Name as: org.postgresql.Driver
  4. Enter the user name and password.

    Note: You can use your "postgres" user account. I have instead created a specific account for coldfusion, you can create users through pgAdmin.

  5. Submit. You should get an "ok" in the status.
Leave a Comment : more...

Form Validation in ColdFusion

by Rolando on May.10, 2007, under ColdFusion

This is a good article on Form validation in ColdFusion with an Object-Oriented approach.  Form validation is one of those tedious tasks that we, the web developers, have to deal with every day.  This article explains how to deal with basic data validation and business rules validation, how to keep these two separated so that we can move our data validation between applications and avoid the rewriting of this one over and over.

Check it out:

Object-Oriented Form Validation in ColdFusion — For Web developers, form validation is a basic task, and yet one that presents some interesting challenges. Even discounting security issues such as SQL injection attacks and cross-site scripting (XSS), form validation is a critical step in your error handling strategy.

Leave a Comment : more...

configuring cfcUnit on Linux

by Rolando on Apr.19, 2007, under ColdFusion

It works great, but as usual you have make a few modifications before getting it to work properly. 

  1. Unzip your cfcUnit file.
  2. Place the inside folder content (cfcunit and org) in your webroot
  3. Modify the file cfcunit/index.cfm and change
    <code><cfinclude template="machII/mach-ii.cfm"/></code> to:
    <code><cfinclude template="machii/mach-ii.cfm"/></code>
  4. Create a mapping to your org folder in coldfusion.
  5. That's it, now run the test as explained in their documentation and it should work!
Leave a Comment : more...

ColdFusion MX: ‘Exception occurred trying to get an MBean’ error when using wsconfig & Java 1.5

by Rolando on Apr.16, 2007, under ColdFusion

When registering Apache 2.x with ColdFusion MX 7.0x using JVM 1.5 you might get this error “Exception occurred trying to get an MBean”
First make sure you have the wsconfig hot fix from Adobe (http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=fa9e26a2).
The ColdFusion webserver configuration utility, known as wsconfig, may encounter the error ‘Exception occured trying to get an MBean.’ The wsconfig utility can be run in either graphical mode or console mode. In either mode, if the wsconfig utility is executed with the Sun JVM version 1.5, then this error will occur. Macromedia has not tested Sun JVM 1.5 with ColdFusion MX for use in running the ColdFusion server or for running the wsconfig utility. It appears that the Sun JVM 1.5 is more strict about getter/setter method invocation.
To fix this problem you can install JVM 1.4 and ensure that the wsconfig is executed using this version of the JVM (You can have multiple JVM’s installed in your system). You can download JVM 1.4 at: http://java.sun.com/j2se/1.4.2/download.html
Note: You only need the JRE (no need for the SDK now).
After installing JRE 1.4, modify the jvm.config file located at [cf root folder]/bin folder (in Windows).
Open the file an edit the line
java.home=
by adding the path to the jvm 1.4. In Windows this is usually found at
C:/Program Files/Java/jre1.4.xx
As you can see I’m using the forward-slash (/) instead of the usual back-slash (\).
The end product should look like:
java.home=C:/Program Files/Java/jre1.4.xx
Save the file.
Notice that I tried using the wsconfig.jar file but it seems that the jar file does not use the jvm.config file always using the default JVM. To avoid this make sure you execute the wsconfig.exe file instead, located at
[cf root folder]\bin
1 Comment : more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...