CB7 Upgrade issue "delegate has already been injected"

I’m trying to update an app from CB5 to CB7. I’ve changed everything in both the CB6 and CB7 “Upgrading to” pages that are listed as either changed, removed or deprecated to the suggested “newer” version (as far as I can see) but when I try to access any endpoint of the app (it’s a REST API), I’m getting the following error message:

Lucee 5.3.10.120 Error (DuplicateDelegateException)
Message	The method: ($WBAOPSTOREJOINTPOINT) from the (coldbox.system.web.delegates.Interceptor) delegate has already been injected by (coldbox.system.core.delegates.Async)
Detail	The target object is (coldbox.system.web.routing.Router).
Extended Info	Current Injector -> root

I’ve moved everything over from Router.cfm to Router.cfc as shown in the docs and removed the Router.cfm file, but the above error message would suggest there is something wrong in terms of the router configuration. However, if I drop back to CB6 and remove the CB7 specific changes the API works ok again, even with the new Router.cfc file, so I think that is correct.

I’ve also tried, on CB7, removing everything from the Router.cfc and just having the bear minimum:

component{
    function configure(){
		route( "/:handler/:action?" ).end();
    }
}

but even with that I still get the same error message on all requests.

I’ve searched for the above error message and haven’t been able to find anything even remotely similar. Does anyone know what might be wrong and need changing for this to work on CB7 or at a minimum move pass this particular error message?

Thanks.

Andrew.

Is there a way you can have a reproducible test case?

I can’t replicate that exception.

@lmajano Not that I have been able to. It must be specific to this app, but my limited CB knowledge is hampering me from finding the cause. It is obviously trying to inject the same thing twice and the second time it fails because it is already injected. I’m just not sure where to look for it and identify it, but it clearly wasn’t an issue in CB5 or CB6, so something has changed there as well I guess.

https://ortussolutions.atlassian.net/browse/WIREBOX-148

I think I pinpointed the issue

I committed a test fix. Let it build and test it against @be

Thanks @lmajano I’ll take a look in a bit and let you know.