LazyApps simple problems need simple solutions

-->

OpenBD vs. ColdFusion Gotchas

This is just a random collection of gotchas and other stuff I stumble over trying to port my apps from ColdFusion to OpenBD.

CFFTP: The attribute connection must be a valid variable name. In CF a connection named “123abc” is valid, in OpenBD it’s not.

cffunction: When the returntype is set to date OpenBD always returns a date object, but in CF you can return an integer, like the epoch.

Tags: OpenBD doesn’t support comments inside of tags. <cfset taxes = 0 <!— show me the money —> /> will work on CF, but not on OpenBD.


OpenBD + Tomcat Example Setup

Note: I’ve experienced some weird behavior running multiple apps on a global OpenBD setup like this. I have reverted back to copying the runtime libraries into every apps own /WEB_INF/lib directory, and removed the added shared.loader entry in catalina.properties

This is how I’ve setup OpenBD on Tomcat to easily upgrade when a new version is released, AND to eliminate the need of having the OpenBD runtime inside every webapp.

I’m using Tomcat 6.x but I imagine this applies to jetty etc. as well with a little tweaking.

It’s not battle tested in any way, And I’m sure there are gotchas to this approach, but it have worked so far (approx. 5 hrs)…

I have not needed /bluedragon/jars + /bluedragon/scripts yet, so they are not mapped or linked.

1. Download the openbluedragon.war distro.

2. Unzip the WAR package to your directory of choice, for simplicity let’s make this /path/to/openbd/

3. In /tomcat/conf/catalina.properties, make sure the OpenBD libs are available to the shared class loader (and therefore all apps) in Tomcat, like this:

shared.loader=/path/to/openbd/WEB-INF/lib/*.jar

4. Copy both /path/to/openbd/WEB-INF/web.xml and /path/to/openbd/WEB-INF/bluedragon/bluedragon.xml to yourwebapp/WEB-INF/

5. Change the attribute BLUEDRAGON_XML in web.xml to /WEB-INF/bluedragon.xml

That’s it. You now have a centralized place for OpenBD runtime files, and full config options pr. webapp. Also, when a new version arrives, just unzip (explode) .war file to /path/to/openbd/ and you are good to go :)