[ColdBox 3.7] Wirebox and Railo Secure Archive

Hi there,

We have an application that is running Coldbox MVC and Wirebox on Railo4. Everything has been working fine but we are now attempting to compile the code into a .ras file and it seems that the calls to mapDirectory in the wirebox configuration are not mapping any of the components contained within those directories when they are inside the ras file. Calls to retrieve any of the components mapped by wirebox fail with a “Requested instance not found” error. If we move the file outside of the .ras, then it works fine.

Is Coldbox/wirbox compatible with Railo secure archives or are we doing something incorrectly?

The entire exception we get is as follows:

Error: Requested instance not found: ‘AppSettingsCachingRepository’

Template: C:\inetpub\wwwroot\railo\Develop\coldbox\system\core\util\Util.cfc

Detail: The instance could not be located in any declared scan location(s) (Intranet.sqbox.model) or full path location

Error on line: 164 in C:\inetpub\wwwroot\railo\Develop\coldbox\system\core\util\Util.cfc
Error on line: 237 in C:\inetpub\wwwroot\railo\Develop\coldbox\system\ioc\Injector.cfc
Error on line: 131 in C:\inetpub\wwwroot\Intranet\formatting.cfm
Error on line: 6 in C:\inetpub\wwwroot\railo\Develop\Intranet\Login\site_login_form.cfm
Error on line: 248 in C:\inetpub\wwwroot\Intranet\Login\site_login.cfm
Error on line: 612 in C:\inetpub\wwwroot\Intranet\Application.cfc
Error on line: 612 in C:\inetpub\wwwroot\Intranet\Application.cfc

Type: Injector.InstanceNotFoundException

Thanks,

Ryan

Interesting-- I’ve actually never used the ras files before. Firstly, can you show your mapDirectory() call so I can see what path you’re using. Does it use an app mapping? Server mapping?

This might also be an excellent question for the Railo list, but perhaps we can define a simple repro case without WireBox in the way. Also, can you provide a quick description of how you’re creating the ras file so I can try it locally?

Another test you can do yourself, is dumping out wirebox.getBinder().getMappings(). That’s from memory, but I think it’s right. That will start by telling us if WireBox is even finding your CFCs in the directory.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Hi Brad,

Thanks for your response. Our map directory calls look like this:

mapDirectory(“intranet.sqbox.service”);
mapDirectory(“intranet.sqbox.repository”);
mapDirectory(“intranet.sqbox.common.format”);
mapDirectory(“intranet.sqbox.common.query”);
mapDirectory(“intranet.sqbox.common.wrapper”);

Currently there is no mapping as those paths map to actual locations on our server (eg: /intranet/sqbox/common/format exists in our application dir.)

The dump of wirebox.getBinder().getMappings() confirms that wirebox is not loading any components from the above directories. Only components that are mapped explicitly seem to get mapped. I wonder if this is because those that are mapped explicitly are referenced through the mapping using the dot notation, but those components in the mapped directories must be enumerated so the path provided must be converted to an actual path so that the files therein can be traversed.

If you want to give it a try locally, compiling an ras can be accomplished via the Railo Web Administrator. It’s a bit of a un-intuitive process:

  1. Select the mappings link and create a new mapping. The virtual path will be something like /appname, the resource path will point to your application directory on the OS, and the archive path will point to where the ras file will exist (the name of the ras file should also be included on this path (something like c:\inetpub\wwwroot\app\archive.ra)
  2. Save the mapping, then click the button beside the new item to edit it.
  3. Click on the download archive button and download the file to the location specified by the archive path above.
  4. You should now be able to access your app at the virtual path specified in the new mapping.
    Thanks for looking into this for us.

Cheers,

Ryan

Does anyone have any ideas on this? We are attempting to build a secure archive and have many cfc’s that are loaded by wirebox using mapDirectory. Is our only option to manually list all of our resources one by one in the wirebox config?