Hi
I’ve just created a new app by running “box install coldbox” and “box coldbox create app MyApp”, but when I try to run it I get the following:
The method getMetadataCache was not found in component [appfolder]/config/WireBox.cfc.
Ensure that the method is defined, and that it is spelled correctly.
The error occurred in [appfolder]/coldbox/system/ioc/config/Mapping.cfc: line 607
Called from [appfolder]/coldbox/system/ioc/Injector.cfc: line 348
Called from [appfolder]/coldbox/system/web/services/RoutingService.cfc: line 117
Called from [appfolder]/coldbox/system/web/services/RoutingService.cfc: line 53
Called from [appfolder]/coldbox/system/web/services/LoaderService.cfc: line 52
Called from [appfolder]/coldbox/system/Bootstrap.cfc: line 98
Called from [appfolder]/Application.cfc: line 32
605 :
606 : // Are we caching metadata?
607 : if( len( binder.getMetadataCache() ) ) {
608 : // Get from cache or produce on demand
609 : md = injector.getCacheBox().getCache( binder.getMetadataCache() ).getOrSet(
Any idea?
What version of ColdBox is installed?
package list
Does your wirebox.cfc extend the base binder class? I think that’s optional now but just checking.
I just ran the same commands you showed and followed with a “server start” command and it works fine. What CF engine/version are you using?
Running “server start” works for me as well. I’m trying to get it running on CF11 (ColdFusion 11 Update 14).
Ok I added the following to Application.cfc and it’s working now:
this.mappings[ “/coldbox” ] = COLDBOX_APP_ROOT_PATH & “coldbox”;
I’m wondering if the “box coldbox create app” command should add this line by default to Application.cfc so that it’ll work out of the box for apps in subfolders?
It sounds like you didn’t put your Coldbox app/framework in your web root. That’s certainly acceptable, but then it’s up to you to provide a CF mapping so the Coldbox framework can be resolved. The “coldbox create app” command really has no idea where your webroot is. You just point it to a folder and it does its thing. It’s unrelated to any servers you may or may not start in proximity to that folder. We could try and guess, but then we’d still be wrong in other cases. That’s why the rule of thumb is that if you’re not in the web root, it’s up to you to provide a mapping. Some people don’t even store the Coldbox folder in the web root at all!
That said, I’m surprised you got the error you did. I had Luis put in a specific check for this in ColdBox 5 to provide a better error message. Perhaps there was a regression.