[coldbox:14769] Error updagading to 3.5

name=“bean.body” could work, but it all depends on your configuration.
Wirebox is built around the idea of mappings, where a mapping is a definition of an object you want WireBox to create. Mappings can be explicit or implicit. An explicit mapping would be

or mapDirectory(“com.bar”);

Explicit mappings are processed ahead of time and stored by wireBox. They are referenced by an ID. The ID for the first example would be “foo”. The second example RECURSIVLEY maps all CFCs in the com/bar folder and their ID is the CFC name unless you have specified an alias annotation in any of the CFC.

The DSL to wire an existing mapping is “model:ID” where ID is the ID of the mapping. This could look like:

property name=“myRandomName” inject=“model:foo”
property name=“foo” inject=“model”

In that last example, the ID defaults to the name of the property.

Now, comes implicit mappings . These aren’t defined by you, but are “searched” for by WireBox in your scan locations the first time you ask for it and the mapping is created then automatically. Scan locations are essentially the convention for where you store your models, just like how handlers is the convention for where you store your handlers. In the same way, scan locations require that you specify the FULL PATH to the object you want relative to the root of the scan location. If WireBox can’t find a mapping with an ID that matches what you’re asking for, it will look in the scan locations, but the search is NOT RECURSIVE. The path you give must be relative to the root of your scan location.

The default scan location is “model”, so consider the following directory structure:


The following DSLs would be valid:

property name=“myFoo” inject=“model:foo”
property name=myBar" inject=“model:com.bar”
property name=“user” inject=“model:com.mysite.user”

So, back to your example, if you used mapDirectory(“shared.model”), then you have asked WireBox to create explicit mappings for all CFCs within that folder and its sub folders. The IDs will default to the name of the CFC so, assuming you only have one CFC called “body.cfc”, you should be able to reference that mapping like so:

property name=“body” inject=“model”
property name=“myBody” inject=“model:body”

However, if you had added a scan location (you can have more than one) to “shared.model”, then you would have needed to reference the full component path WITHIN the scan location like so:

property name=“myBody” inject=“model:bean.body”

Hopefully that helps clear up how WireBox resolves your mappings.



Apperently what I’ve decided is to replace all bean.Body with just a body, and it seems to work for me