Modifying Reactor to work with BlueDragon 7 JX
ColdFusionI am currently working with an existing Mach-II /Reactor application that we are planning on moving to BlueDragon7 JX under Linux. Yesterday I ran it under BD for the first time and found some errors that we had not seen before, so I began walking through a series of changes to get the application running. So far the only changes I have had to make are within the Reactor framework itself. I want to be clear that BlueDragon is not currently supported under Reactor, so these changes are not in any way officially sanctioned by the Reactor project, but I thought I would make them public in case others found themselves in the same situation.
First, I would like to mention that out of the gate, the Mach-II 1.1.1 framework worked flawlessly... so thanks Peter and Matt! Not only that, but our application uses SES urls (pattern: /index.cfm/name/value), which BD processed properly without having to modify any settings. This was good news as I really didn't have any idea how deep our changes were going to have to go.
To get the application running, there have been only 3 issues that I have run across so far, which were fixed fairly simply. My testing has been limited (shut down the laptop at 1am last night!), but so far things seem pretty stable. The issues are as follows:
- In the Reactor config XML, you cannot define an alias like this:
<object name="bad_name" alias="GoodName" />
It has to be done like this:
<object name="bad_name" alias="GoodName">
</object>
Not only do you need to have a separate closing tag, but it actually has to be on a new line, or it will fail. Interestingly, I have some similar declarations in my Mach-II config for "foo" events to avoid generating exceptions when they are hit and they do translate properly, so it doesn't appear to be a BlueDragon limitation as far as I can tell. For example I have just an empty event in Mach-II defined like this: <event-handler event="robots.txt" access="public" />
- isNull() method in query.cfc was modified throughout the code base to become _isNull(). Apparently isNull() is an existing method within BlueDragon and as such is a reserved word. This affected the following templates:
reactor/query/query.cfc - (4) - lines: 383,384,560,561
reactor/query/where.cfc - (2) - lines: 177,181
reactor/query/render/where.cfc - (2) - lines: 285,291
- I was receiving errors in /reactor/query/query.cfc that indicated that there was an ambiguous method when calling the Java method buf.append("whatever string"). In this CFC, "buf" is a Java component that is instantiated like this:
createObject("JAVA", "java.lang.StringBuffer").init()
Once it is instantiated, the append() method is used to append strings to the buffer as you move through the CFC. You can see by dumping the StringBuffer object that it contains several append methods. Java knows which one of these to use based on the type of argument that is passed to the method through what is known as method overloading. Apparently, BlueDragon does not tip off Java to the fact that what is being passed is a string the way that it seems to occur in ColdFusion. I could not find the source as I was writing this entry, but I believe I have read that under the covers all simple variables in ColdFusion are treated as Java strings, and I imagine that has something to do with it. To resolve this, I had to modify those calls to be:
buf.append(JavaCast("string","whatever string"))
throughout that CFC (120 places!)





Loading....