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

50 views
Skip to first unread message

Dina Hess

unread,
May 11, 2016, 3:50:20 PM5/11/16
to ColdBox Platform
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: 

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.


Luis Majano

unread,
May 11, 2016, 6:51:40 PM5/11/16
to ColdBox Platform
Can you remove the auto reload and try again

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




--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/cecbd390-0da0-482d-b69d-9f6f1f2a0128%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brad Wood

unread,
May 11, 2016, 6:54:17 PM5/11/16
to col...@googlegroups.com
Did you declare your custom route before the default route? They are matched in they order declared.



Happy Connecting. Sent from my Sprint Samsung Galaxy S® 5

Dina Hess

unread,
May 12, 2016, 9:01:55 AM5/12/16
to ColdBox Platform
Shortly after posting this, the answer suddenly popped into my head! I had forgotten to add "--rewitesEnable" with "server start" in ColdBox. 

Dina Hess

unread,
May 12, 2016, 9:04:07 AM5/12/16
to ColdBox Platform
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?

br...@bradwood.com

unread,
May 12, 2016, 9:38:26 AM5/12/16
to col...@googlegroups.com
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: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
Subject: Re: [coldbox:25679] [coldbox-4.2.0] Can't get past HandlerService.EventHandlerNotRegisteredException
From: "Dina Hess" <dina...@gmail.com>

Dina Hess

unread,
May 12, 2016, 10:56:24 AM5/12/16
to ColdBox Platform
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();

br...@bradwood.com

unread,
May 12, 2016, 11:17:17 AM5/12/16
to col...@googlegroups.com
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"] {
  }
--------- Original Message ---------

Dina Hess

unread,
May 13, 2016, 9:19:21 AM5/13/16
to ColdBox Platform
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. 

br...@bradwood.com

unread,
May 13, 2016, 11:20:45 AM5/13/16
to col...@googlegroups.com
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!
 
--------- Original Message ---------
Reply all
Reply to author
Forward
0 new messages