[coldbox-4.2.0] Can't get past HandlerService.EventHandlerNotRegisteredException

Just trying out ColdBox, so very new to this…

I have a route set up in coldbox.cfc like this to test a REST service:
addRoute(pattern = “api/statusboard/:appName/:statusBoard/:userId”, handler = “api.statusboard”, action = “list”);

And coldbox.cfc also contains this setting:
setAutoReload(true);

…\handlers\api\statusboard.cfc contains a method:
function list(event,rc,prc) {…}

I started my application in CommandBox, then used the assigned port to hit the application:
http://127.0.0.1:61542/api/statusboard/logistics/customer/99999

But I keep seeing this error:
Type: HandlerService.EventHandlerNotRegisteredException
Messages: The event: api.statusboard.logistics is not valid registered event.

What am I doing wrong? Why is “logistics” being interpreted as part of the event rather than a parameter?

I’ve also tried http://127.0.0.1:61542/index.cfm?fwreinit=1 and restarting the ColdFusion service.

Still no joy.

Can you remove the auto reload and try again

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057

Would you please explain to my “newbieness” why that might make a difference? I thought that reloaded the routes for each request, which is what we want in development. Did I get that wrong?

Some times that setting can cause issues if you have more than one request at the same time (like ajax calls) and the routes are being reloaded since it’s not thread safe. It’s also a lot slower. I leave the auto reload turned off and simply reinit my application with ?fwreinit=1 while in development.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Thanks; I’ll implement your recommendation.

Now my hangup is “invalid component definition, can’t find component [storedproc]” related to:
function getStatusboard(appName, statusBoard, userId){
var procName = “”;
var result = “”;
var spService = new storedproc();

What CF engine are you on? Lucee doesn’t support the stored proc CFC that Adobe CF has. You can find a shim to use, but I would just recommend the built-in syntax:

storedproc
  [blockfactor="number"]
  [cachedafter="datetime"]
  [cachedwithin="timeSpan"]
  [cachename="string"]
  [datasource="string"]
  [debug="boolean"]
  [password="string"]
  procedure="string"
  [result="string"]
  [returncode="boolean"]
  [timeout="number"]
  [username="string"] {
  }

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Apparently I was using Lucee (per exception dump). That must be the default when you create an application via CommandBox? I’ve since set up the application in IIS/CF11 and added the IIS URL Rewrite feature. All is working well now. Thank you for your help getting me started.

Creating an app with CommandBox has nothing to do with a particular server-- it just creates files and folders for you. Starting a server does default to Lucee 4.5. However, you didn’t need to go through all the work of setting up CF11 and IIS rewrites. CommandBox does all that for you too!

http://www.codersrevolution.com/blog/commandbox-multi-server-support-now-in-beta-v310

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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