Wednesday, February 09, 2011

ColdFusion 9 - Multiple Sites - ColdBox - gotcha!!!

Yesterday I had this weird situation happen to me as I was developing locally on my Mac/Apache. Basically I was developing a second ColdBox site, set up as a VirtualHost which makes it easy for me to see in my browser by using URLs like http://site1.local and http://site2.local, which I control in my hosts file.

Well, now for the problem. Basically as I called App#1 everything worked fine but once I tried to access App#2 it would error out. As I started to troubleshoot a little more I noticed that App#2 was trying to execute a handler from App#1 (which I noticed by looking at the path in my error debug output). In truth, I wish I could say I figured it out right away but it took me a white as first I thought it was an apache issue and spend time looking at logs etc, then I finally decided to look at my ColdFusion administrator and by luck just decided to look at my Cache settings and there it was! ColdFusion 9 has a new setting called Component Cache, which caches component path resolution and then does not resolved again (picture below).


So basically once the sites would go execute the handler, it was resolving to the first path. ColdFusion9 has this checked by default and should not be for Multiple Site servers just like Cache web server paths setting. Hope this helps anyone out if you run into this new problem.

No comments:

Post a Comment