CFGroovy 1.x Features

It was a big weekend for CFGroovy.  In addition to the 1.0 release, I started doing some work for the 1.x series (which is available in the trunk).  There are several significant changes to  the engine:

  • Groovy has been upgraded to 1.6.0 from the previous 1.5.6 version.
  • You can specify a custom Groovy JAR for your CFGroovy.cfc instance to use if you don't like the default one.
  • You no longer have to manually copy the Groovy JAR into /WEB-INF/lib as part of installing CFGroovy, the engine will bootstrap the JAR itself.
  • Portions of the engine are now implemented in Groovy instead of CFML.
  • Bootstrapping a new runtime is noticeably slower, so make sure you're managing your runtime and not recreating every request.

The demo app has also gotten some love.  It now does a better job with detecting whether it thinks it can run on a given environment, and is a bit smarter about helping the user get up and running.  I've also created a slightly more complex Hibernate example.  I wanted to package a "real" app as a demo, but I couldn't get something from the real world that was both simple and complex enough.

On the negative side, I did a bunch of digging, and it appears that having Hibernate already in the server's classpath prevents CFGroovy from correctly bootstrapping it's internal version.  The problem seems to reside in the way Hibernate is implemented internally, so not something I can fix.  Note that this only affects Hibernate – the core CFGroovy framework will happily run your Groovy code regardless of Hibernate conflicts.

This issue explains why CFGroovy fails on many versions of JBoss, as well as CFML runtimes that bundle Hibernate (cough … Centaur … cough).  The "solution" is to remove the Hibernate JARs from the webapps's classpath, though this obviously means the webapp can't use Hibernate except through CFGroovy.  However, I'd expect that the number of "real" applications using Hibernate through multiple channels is virtually zero, so it's more of a PITA than a showstopper.  I plan to do a bit more research on this, but I'm not optimistic of finding a solution.

3 responses to “CFGroovy 1.x Features”

  1. Running CFGroovy on in a Hibernate-Aware Environment at BarneyBlog

    [...] Contact « CFGroovy 1.x Features [...]

  2. John Allen

    This is a really cool project. I have messed around with it a lot on a personal project. It is solid.

    Thanks mucho Barney.

    You rule.