Module External Location Issue

Hi,

I’m having modules in my application and I want to use my modules as core functionality multiple applications.

I know that I have to assign path to modulesExternalLocation in config (updated my config with modulesExternalLocation= ["…/RegistartionModules/modules/users"],) and I’m getting error.

Below is my application structure

/Root

application1
Coldbox
Handlers
Views
Model
Layouts
Application.cfc
Config

application2
Coldbox
Handlers
Views
Model
Layouts
Application.cfc
Config

RegistartionModules(Modules)

Modules
Users
Moduleconfig.cfc
Handlers
Views
Model
Layouts

In my routes.cfm I’m having addModuleRoutes(pattern="/users",module=“users”);

When I run my application I’m getting Error importing routes configuration file: Error loading module routes as the module requested ‘users’ is not loaded. The loaded modules are:

Please provide any help to fix this.

Thanks,

I think you need to take a step back and look at this again, your issue is the modules path, even though you have given it a relative location. You will find that this is not relative to where the script to actually load the module from.

So if we look at who loads up the modules, we can see that it is the ModuleServce located in the coldbox/web/services folder. Thus the relation will be taken from there and not where you think it is.

Hope that makes sense.