March 12, 2010

Pages


Search Site


Subscribe

...to receive future posts via email.

Topics



Archives

Entries Tagged as 'OpenBD'

Making New Toys Play Nice: Model Glue 3 & Open Blue Dragon

May 27 2008 by Adam

If you're like me (a glutton for spiffy new technology, and even more-so when it's free) then you've played around with Open Blue Dragon, and probably the latest release candidate for Model Glue 3. Unfortunately, they don't play nicely with each other out of the box. In this post, I'll document everything I've done in order to make MG3 run on OpenBD.

For reference, I'm running the Jetty-server-included version of OpenBD on Debian, against MySQL — which, by the way, is an awesome way to get a development environment up and running in no time flat!

The first problem I hit was this error: Bean creation exception during init() of ModelGlue.gesture.modules.internal.generation.service.XMLEventGenerationService MG3 error on OpenBD

After a little searching around, I found this post on the Model-Glue discussion group, where the issue reporter was describing almost exactly the same issue, and the response by Dan Wilson was that MG3 requires some of the new functionality packaged with ColdFusion 8 — but that he had submitted a bug report for it in the MG bug tracker, and provided a modified version of the file in question that uses a work-around for the issue. I tried this file and it resolved my issue. Dan says that the resulting XML may not be very pretty, but this is at least a starting point and might be improved on. Once you've gotten that resolved, you'll find that Model-Glue is throwing errors while loading itself.

Model-Glue 3 includes something called "helpers" which appears to mostly be a collection of UDFs; and this will be where your errors are happening. If you don't intend to use any of the helpers (or can/will copy any needed functions into your application manually), you can just delete the .cfm files in /ModelGlue/helpers/ and skip the rest of this step. Otherwise, what you'll need to do is run each helper file as if it were one of your pages, individually, and resolve all of the errors it throws. I will include downloads for any files I modified for this post.

OpenBD has some functions defined (CharAt, listRemoveDuplicates, etc) that aren't defined in Adobe ColdFusion CFML — these you can just comment out — and you'll also find some syntax like !=, ++, <=, and % that will need to be converted to neq, mod, lte, etc. NOTE: The baked in functions that collide with UDFs may not work the same way as the ones you're commenting out, so be sure to either look up their documentation, or thoroughly test before you rely on them. I changed: StrLib.cfm, DataManipulationLib.cfm, and DatabaseLib.cfm (switched a cfscript-style comment outside of a cfscript block to a normal CFML comment). Once each of these files will run individually without error, try your index.cfm again and you should see everything up and running!

As promised, here are the three files I modified. Don't forget to grab the modified copy of CGCodeGenerator.cfc from this post. I see that these helper issues have also been logged as bugs, so hopefully they will all be resolved before a final version is released.

MG3 working on OpenBD

UPDATE 5/30: At this point, it looks like code generation just doesn't want to work on Open Blue Dragon. Sean Corefield responded to a post of mine on the model-glue mailing list about it not working, and says that Joe is aware of the issue (with another Java class used) and plans to rewrite the code without using these problem classes at some point. Hopefully we'll see them fixed before a final release.

Posted in ColdFusion | Frameworks | Model-Glue | OpenBD |