Entries Tagged as coldbox
At World Singles, we're just going thru the process of upgrading from Railo 3 to Railo 4 (specifically from 3.3.4 to 4.1.1) and I thought I'd jot down a quick blog post about it. First off, I should explain that we use the WAR install on a vanilla Tomcat install, and mod_proxy_ajp to connect Apache to Tomcat. See my Railo for Dummies blog post from 2009 about setting up that sort of environment for background. We have three web contexts (web applications), each running their own configured WAR install of Railo, so we can package each web application up easily and move it around, including the Railo runtime. We can also upgrade each web application separately.
We'd already upgraded from Java 6 to Java 7 (download and unpack the JDK from Oracle into a new folder, update the symlink for the default java executable), and from Tomcat 6 to Tomcat 7 (download and unpack the Tomcat archive from Apache into a new folder, update the symlink for the current version, copy setenv.sh and context.xml from the old to the new - we'd customized those - and then add <Host..> entries to server.xml as necessary). Piece of cake so far.***
I expected the Railo upgrade to be more work than Tomcat. I was wrong. A pleasant surprise! I downloaded the new Railo 4.1.1 WAR file and unpacked it into a temporary folder (using jar xf /path/to/railo-4.1.1.009.war). Then I copied the WEB-INF folder over my existing Railo installations:
tar cf - WEB-INF | ( cd /path/to/application/webroot; tar xf - )
That's just my go to method for non-destructively copying a whole directory tree on top of an existing set of files. The only file that needed customization was web.xml in one web application context where we had some SES URL patterns that matched subfolders. That was just a matter of adding three <url-pattern> lines to the <servlet-mapping> section for the CFMLServlet. That's all it took: download, unpack, copy (and a small edit). Started up Tomcat and Railo happily deployed itself into each web application context, without overwriting any of my previous Railo 3.3.4 settings in the three admins. Nice!
Any code changes? Yes, just two: ColdBox has a MessageBox plugin that uses isEmpty() which is now a built-in function - changing the two unqualified calls to this.isEmpty() solved that - and a couple of strange places where I'd accidentally used float and int as function return types in cfscript - this worked in Railo 3 as if I'd written numeric but in Railo 4 it was type checked as a Java primitive type (interesting in itself!) so I just changed those to numeric and everything else just worked!
***Piece of cake except for Braintree which is one of our payment providers. We were using an older version of their library and once we moved to Java 7, the security certificate processing was more strict and calls to their sandbox (not their production system) failed. Updating to the latest Braintree JAR on Maven Central fixed that.
coldbox · coldfusion · railo
The cf.Objective() 2014 Call for Speakers is open until November 1st so you have just under two weeks to submit your topics. You can also vote for existing topic submission at that same link.
And if you want to submit non-CFML web development topics that you think would appeal to a CFML / JS audience in terms of broadening their skills, you should do that too! Last year Scott Stroz did an excellent talk about Groovy on Grails, and I touched on some advanced CFML techniques inspired by other languages in my polyglot talk.
Note: when you submit a talk, please make sure to follow the guidelines outlined in this blog post about cf.Objective() 2014 submission format!
An updated version of my slide deck for my case study talk about Clojure and CFML at World Singles has been posted to my presentations page. I'm happy to give the talk to other user groups, even remotely if you have the capability for a remote presenter. The talk runs about two hours, or longer depending on the amount of Q&A.
coldbox · coldfusion
World Singles is looking for a smart, motivated developer to join our small, fully distributed team of engineers, working on our multi-lingual, multi-tenant Internet dating platform. We're after someone with strong data management skills who can help us mine and analyze data in both MySQL and MongoDB, as well as help us leverage both more effectively. For more details: http://bit.ly/worldsinglesjob
The World Singles code base is a blend of CFML and Clojure - this role would be mainly on the Clojure side of the house but the primary skills needed are MySQL / MongoDB.
clojure · coldbox · coldfusion · mongodb · programming · worldsingles
As my readers will no doubt know by now, I have a large CFML application and I'm migrating low-level parts of it to Clojure to that I can reuse those pieces from both CFML and Clojure (and Scala). I recently migrated all of the environment control logic, which automatically configures the application based on which server the code is running on top of, to Clojure so that my CFML, Clojure and Scala code could all leverage the same environment control logic. I'll probably blog about that at some point. I've also created a Clojure replacement for the CFML ORM we've been using (Reactor). Today, however, I want to talk about logging.
[Read more →]
clojure · coldbox · coldfusion
February 03, 2010 · 1 Comment
This year's cf.Objective() is offering SIX pre-conference classes! You can choose from Building Secure CFML Applications, ColdBox: 100 Training, Developing Applications with ColdFusion 9 ORM, Getting Started with Flex / AIR Development, Mach-II / OOP from the Ground Up, Rapid Development with Model-Glue 3! Wow!
Some of these are one-day courses (Wednesday April 21st) and some are two-day courses (Tuesday April 20th and Wednesday April 21st).
air · cfobjective · coldbox · coldfusion · flex · machii · modelglue · orm
Since I spent quite a bit of time wrestling with this over the last week, I figured this blog post may help others. First off, a caveat: I'm running the latest version of ColdBox 3.0.0 from SVN which is "almost" Beta 4 and the details of error handling have changed a little over the last few Betas (for the better).
ColdBox provides a number of ways to handle different types of errors. I'll cover the following options:
[Read more →]
coldbox · coldfusion
Today I needed to update a custom tag we use to display form fields in a ColdBox app to treat the labels as i18n resource keys. Normally in a view you can just call getResource(key) and get back the translated value based on the current locale. Simple. Part of what makes ColdBox great for international apps!
However, you can't call getResource() inside a custom tag called from a view. You might think you can just do caller.getResource(key) but that fails with an exception that the variable controller is not defined. That's because your views run in the context of a CFC and the custom tag has its own context.
I initially came up with a slightly complicated way to pass things to the custom tag but I ended up having to make getResource() public in ColdBox's FrameworkSuperType.cfc. Not ideal. It worked but it was clearly a hack.
I complained to Luis about how hard this seemed to be and he sent me the following code snippet to use in a custom tag:
<cfset variables.controller = caller.controller />
... caller.getResource(key) ...
Remember that you're in the context of a CFC in your view? Well, getResource() is in the variables scope and it, in turn, references controller - which is in the variables scope of the view... or rather the context that the view is executed in. So by setting variables.controller in the custom tag, the call to caller.getResource() finds it and runs properly.
It's still a bit of a hack in my opinion but it's slightly more elegant than what I was trying to do so thank you Luis.
I'm posting it here so a) I can find it again in future and b) others may benefit from this.
coldbox · coldfusion
I'm working on a ColdBox project right now for a client and, as some may have gathered from my occasional tweets, I've set up Hudson
as a Continuous Integration server that pulls the latest code from git, restarts the test server instance, reloads the test database and automatically runs the MXUnit-based test suite, whenever someone commits files to the main git repository.
We have unit tests for individual components and we have integration tests for the ColdBox event handlers. Luis has provided pretty good documentation for writing such tests but one of the challenges I faced in getting some of the integration tests working was that they redirected to a new event!
[Read more →]
coldbox · coldfusion · tdd
Luis Majano just announced ColdBox training
the day before CFUnited
. If you're going to CFUnited this year and you're interested in learning more about ColdBox from the creator of the framework, I can highly recommend this intense, one-day pre-conference training class!
I was privileged to sit in on parts of this course before cf.Objective() this year and was very impressed at the amount of material covered, the quality (and thickness!) of the handouts and the hands-on approach that Luis takes.
cfunited09 · coldbox · coldfusion