Russell's Blog

The nicest guy you'll never know
Vimeo Flickr Twitter RSS

Coldfusion 9 date and time data type error bug

ColdFusion-9

Moving from Coldfusion 8 to Coldfusion 9, a bug reared its ugly head immediately. If your code either updates or inserts into a SQL datetime column, Coldfusion will spit out a datetime error:

[Macromedia][SQLServer JDBC Driver][SQLServer]The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

This happens no matter if you use a variable (eg. #query.date#), #createODBCDateTime()#, or #now()#. This worked without error with Coldfusion before CF 9.

I had to go through all the code, changing all datetime variables to use cfqueryparam cfsqltype=”CF_SQL_TIMESTAMP”, and replacing all occurrence of #now()# to the SQL function to getDate(). Then the code would run without error.

As far as I know this has not been fixed in the Coldfusion 9 hot fixes and updates.

posted under Coldfusion | 1 Comment »

Railo, Tomcat, IIS and default index page giving a 404.

With Railo, Tomcat and IIS working in harmony, there was one thing I just coudln’t get to work – the default index page would give a 404 error. Using '/example/index.cfm' worked, but '/example' or '/example/' would not.

A quick Google search presented several possible solutions:

Making sure 'index.cfm' is in the list of default content pages within the IIS website document properties.

Making sure '/*.cfm=ajp13' was listed within the 'uriworkermap.properties' file in the Tomcat conf folder.

Both these were already done, and still nothing. Another solution was outlined at several sites, including http://cflove.org/2010/12/railotomcat-and-iis-http-error-443-not-found-the-page-you-are-requesting-cannot-be-served-error.cfm, which looked at Handler Mapping within IIS. This did work fine, except Railo Session and Client data was being lost everytime it would redirect to the default index.cfm. So, when a logged in user went to Continue reading »

posted under Coldfusion | No Comments »