Category: Coldfusion Server

Jul 7 2010

Flex and ColdFusion Objects

Recently ran into something very strange. I was returning a structure to Flex from a ColdFusion Component and FLEX was receiving the structure keys as all UPPERCASE.

Take the following component.

<cfcomponent>
 <cffunction name="helloWorld" access="remote">
  <cfset var result = structNew() />
  <cfset result.msg = "Hello World!" />
  <cfreturn result />
 </cffunction>
</cfcomponent>

When called from Flex, the result will come back as

result.MSG

I guess ColdFusion doesn't see the case being used in the struct.key assinment.  If you want to retain the case of your structure keys you need to assign them like this..

<cfcomponent>
 <cffunction name="helloWorld" access="remote">
  <cfset var result = structNew() />
  <cfset result["msg"] = "Hello World!" />
  <cfreturn result />
 </cffunction>
</cfcomponent>

Creating your structures this way will retain the case of your keys and Flex will receive them in the way you have named them.

1 comments - Posted by Steve Onnis at 11:17 AM - Categories: Coldfusion | Coldfusion Server | Flex

Jul 7 2010

Oracle 10g Lite dates and Coldfusion 8/9

If you are running Oracle 10g databases and Coldfusion Standard 8 or 9 you may experience a problem with ColdFusion returning dates with a 00:00 time value.   This is a driver issue.  The driver that comes with the Oracle 10g database is for JVM 1.4 and 1.5.  ColdFusion 8 actually ships with JVM 1.6.  What you need to do it download and install the newer driver for the Oracle 11g database. I don't believe there is a lot of difference but the main one is that it is for the JVM 1.6 platform.  Installing the updated driver will correct the date/time issues.

If you are using ColdFusion Enterprise and you are using the packaged Oracle drivers you don't need to worry about this as they are correct drivers.

0 comments - Posted by Steve Onnis at 11:10 AM - Categories: Coldfusion | Coldfusion Server | Oracle

Jul 7 2010

Migrating ColdFusion Standard Servers

We all know that you can export ColdFusion Server settings from one server and import them into another server, but this functionality is only available on Enterprise edition servers which makes migrating Standard servers a bit of a pain.

As you may know, the Developer edition of ColdFusion server has all the functionality of the Enterprise edition so why not just revert your server back to Developer edition so you can export your settings.  Sounds easy enough, just log into the admin and enter "Developer" into the serial number field and update. But no....this is actually an invalid serial number. So what we need to do is manualy modify the file that contains your ColdFusion server license called "license.properties".  This file can be found in the "<CFINSTALL>\lib" directory, so if you have a default install for ColdFusion 8 it would be in "C:\Coldfusion8\lib\license.properties".

The file will look something like this:

#CF License File
#Mon Jul 05 23:36:03 EST 2010
appserver=0V\=LUFWP]J(Z^V)[G?G5'C@  \n
code=-4579634782920590441
sn=1234567890123456
listen=true
user=
trial_sn=
installlanguage=en
installtype=standalone
company=
previous_sn=
vendor=0V\=LUFWP]J(Z^V)[G?G5'C@  \n

What you need to do is change the "sn" value from your serial number to "Developer", restart your ColdFusion server and presto! you can now export your ColdFusion server settings.  Make sure you save your serial number so you can change it back once you are done.

This same method applies for Coldfusion7/8 and 9.

0 comments - Posted by Steve Onnis at 10:52 AM - Categories: Coldfusion | Coldfusion Server | General

Sep 19 2009

Custom ColdFusion Virtual Mappings

I recently has a requirement to create a shared resource across all of my coldfusion hosting customers for an undelivered cfmail spool processing application.  What i didnt want to have to do is create a webserver based virtual directory for each customer because that meant when new customers came on board i would then have to create the virtual directory for them also.

Pre Colsfusion MX, Coldfusion Mappings used to be able to be accessed via the URL but now that is not possible so another means of doing this sort of thing is needed.  Then i got to thinking...there must be a way to do it because thats how the CFCHART url is done as well as the flex/flash gateways as well as the WEB-INF path.

After hunting around in the xml server config files i came across a configuration file located at "[cf-root]\wwwroot\WEB-INF\jrun-web.xml".  This file holds virtual mapping configurations for the Coldfusion server.

To add your own virtal mapping all you need to do is add your own <virtal-mapping> entry.

  <virtual-mapping>
    <resource-path>/{name-of-path}</resource-path>
    <system-path>{absolute-path-to-directory}</system-path>
  </virtual-mapping>

 With the system-path entry, you need to use "/" in the path rather than "\", so if your path is "C:\inetpub\wwwroot\my-folder" you would enter "c:/intput/wwwroot/my-folder".

1 comments - Posted by Steve Onnis at 12:53 PM - Categories: Coldfusion | Coldfusion Server