ColdBox M5 and 2.6.4 Playing Together

To do this without refactoring see: http://www.cfcoffee.co.uk/index.cfm/2010/5/2/ColdBox-M5-and-264-Playing-Together-Continued

Have you downloaded the lasted update from Luis, ColdBox M5? No? Well you should download it right now! So many new goodies, however running CB release M5 alongside my stable version CB 2.6.4 took me a while to set-up in my environment. I have been playing with the new update for a week, but only locally. Now I wanted to actually do something I would need to run it in an environment with an older version.

I run IIS6 and have CB 2.6.4 mapped in my ColdFusion Administrator. Any reference to coldbox/system will use this release. I wanted to run both versions so that my old applications running 2.6.4 still work!

As I found out this can be done very easily following ColdBox Refactoring Guide found here and the Ant Script found in the download. I had a few issues with this tho, not many but here is what I did....

Your set-up many differ from this, this is just my experience!

I Downloaded M5 from the the ColdBox site and placed it on my desktop following the instructions in the refactoring guide. I used ColdFusion Builder to run the Ant script not Eclipse but it's the same.

My default path for my CFC's is coldbox.system, this is mapped in my ColdFusion Administrator to shared/frameworks/coldbox/system. Because my new version is going to run inside the same 'framework' folder I entered not the full path to the new location as the guide shows but the Logical Path. This is my case would be coldbox3.system.

The Ant script however did not actually replace coldbox.system with coldbox3.system but append it to the beginning of 'system'. ie I ended up with the following in the framework code 'coldbox.system.system', which in my case was not correct.

I tired again, this time without word 'system'. After this my paths looked correct. I am not sure if this is an issue with the Ant Script or just something I did wrong.

Now my refactored code is all ready roll (thanks Ant Script). I added the refactored code to my newly created directory folder on the server then created a mapping as you can see below.

Mapping now done I needed to get my CB application to use the coldbox3 path. I installed the advanced example template that came with the CB M5 release download. I then did a find and replace in ColdFusion Builder. In Builder it's done by clicking on the folder you want to replace on and pressing [ctrl + h]

  • I searched for coldbox.system and replace it with coldbox3.system
  • I searched for /coldbox/system and replace it with /coldbox3/system

That's it. O, apart from the error below....

Not sure why this happens yet, but a quick search on the ColdBox forum (users with the same issue) resolved the issue by commenting out the ModelMappings in the default forgebox module > ModuleConfig.cfc.


Now time to play, may have more issues when I start playing with modules but all seems to be fine so far!

TweetBacks
Comments
Jason Dean's Gravatar To me, this seems like so much more work than is needed.

Unless you are still on CF7, I would use application specific mappings for this instead of server-wide mappings. Using app-specific mappings would allow you to map both applications to /coldbox but have them point to different physical directories. This also means you would not need to modify the framework.
# Posted By Jason Dean | 30/04/10 20:14
glyn jackson's Gravatar Thanks Jason, Good idea, I did try this but an existing mapping gave me some issues with an app mapping. also would this not give me issues if not in the web root?

I will have another go.
# Posted By glyn jackson | 30/04/10 21:10
Jason Dean's Gravatar App-mappings should override server mappings.

I am not sure what issues it would cause you. By mapping it to /coldbox you are actually making it easier to deal with applications that are not in the web root.
# Posted By Jason Dean | 30/04/10 22:02
luis majano's Gravatar That error is because you need to patch cf8, implicit structs and arrays in the original cf8 sucked.
# Posted By luis majano | 01/05/10 06:44
glyn jackson's Gravatar interesting comments, thank you both for pointing out these things. I will give it another go as would be good not to have to find and replace everytime.
# Posted By glyn jackson | 01/05/10 09:06
glyn jackson's Gravatar Will also look into the error and see what patching needs doing. Sure I was upto date but maybe not been out of the loop for a little while.
# Posted By glyn jackson | 01/05/10 09:09
Richard Herbert's Gravatar I think you'll have to consider the no-inheritance implementation of ColdBox 3 so you can create your app mapping for /coldbox within your Application.cfc
# Posted By Richard Herbert | 01/05/10 10:15
Glyn Jackson's Gravatar Hi again Richard, I see your point, I cannot extend coldbox.system before the application mapping for coldbox.system is created, that makes sense and the reasons for my error at the start.
# Posted By Glyn Jackson | 01/05/10 22:09
Glyn Jackson's Gravatar Cool, posted another entry on this without refactoring.
# Posted By Glyn Jackson | 02/05/10 17:37
 

About Me

Glyn Jackson, 28 years old, MD and senior developer of a development firm based in Staffordshire called Newebia Ltd. Academic background in BSc Information System & Internet Commerce. Online marketing expert (EE Ranked) and .NET developer. Has been developing with ColdFusion for 5 years and loves it. "I am not a veteran in ColdFusion but I do work on challenging projects which help me learn more about ColdFusion and if I can contribute to the community in anyway then, it's all good!"

Recommends

  • ColdFusion