[wirebox] Conflicting Wirebox Binders - Underlying Scope Issue I suspect

Ok… this sounds like a weird one, and this is me, so of course it is.
I fixed the problem… but there might be an interesting underlying edge case.

We have an interesting setup.

We have a dev branch of code running on one our of dev boxes
We have a staging branch of code running on the same dev box.

I know we should get a separate staging server, but this setup found something interesting.

Our dev branch is ahead of our staging, as we’re doing a lot of changes to our legacy base.
In our onApplicationStart we create our application.injector with a binder, cms.cfcs.wirebox_config

Now, we have a shared mapped folder for our coldbox install

This is where it gets interesting.

If we load up our dev application… wirebox works fine.
Load up our staging application… we get an error. Its trying to map directories that don’t exist.

Restart CF

Load up staging application, wirebox works fine
Load up dev application, wirebox crashes, because its trying to init a CFC that moved.

First things first.
Application Names are different.
I loaded them, dumped app names, definitely different, they have the environment in the app name.

The error stack trace shows some weird stuff.
Loading the staging first, then dev… the error shows a reference in the binder to dev/cms.cfcs.wirebox_config
then it traces into the Injector.cfc in the core files, into the BINDER.cfc etc
then it shows the line number of staging.cms.cfcs.wirebox_config

So, in the process of initializing, Wirebox is pulling the “mapped instance” of the binder of the first INITIALIZED ONE.

So, even though I pass in the right binder… because the binder path is the same… the new app, with different folder structure etc, tries to load the “WRONG” binder… like all the mappings are shared across a server scope or something for the binder.

My solution was to add a mapping called dev_cms to the cms folder… so in the dev environment, it loads dev_cms.cfcs.wirebox_config so the name is different, and the ALIAS / MAP or whatever was causing the conflict before is now not an issue.

I tried to trace it, through several CFCs, but in the end, my solution worked, but that made me think… if I name my binder wireboxconfig.cfc in the CFCs folder for all my sites, are they going to conflict like that?

Or is it not an issue if the ColdBox folder is actually in the site, instead of mapping? Does wirebox create a server instance based on its path maybe?
Or does the java hash of the object use that?

Anyways, i know it is strange… but with coldbox MAPPED into my sites, with the same binder path, it was effecting each other, regardless of the application name.

Its on CF9.
Strange, any insight?
It might be a bigger

Where does the Binder Config’s get stored and how.
Really curious

Check and make sure you don’t have component caching enabled in the CF administrator.



ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Did you get a chance to check that setting, gavin?

Brad, you are a legend.
I finally tried it, and you are right.

I wonder how often that might have bitten me before.
At least I feel better knowing I wasn’t missing something in the code.

I shouldn’t have doubted the mighty WireBox