Missing event handler in external location

13 views
Skip to first unread message

br...@bradwood.com

unread,
Jan 19, 2011, 4:32:07 PM1/19/11
to ColdBox List
RC1

The HandlerService does now allow the onInvalidEvent to exist in the external handler's location for missing handlers.  It does, however work for missing events.

For instance, my onInvalidEvent exists in my external handlers location.

Let's assume for the sake of the example that ehMain is an existing handler.

If I try to go to index.cfm/ehMain/foobardoesnotexist then I correctly get taken to my onInvalidEvent handler.  This is because getRegisteredHandler() has not been run yet, and the framework has not decided where the handler CFC exists.

However, if I try to go to index.cfm/notgonnafindme/foobardoesnotexist then an error is thrown on the first line of the newHandler() method when it tries to create the handler object because onInvalidEvent blindly overwrote the handler and method properties of the event handler bean with checking whether or not the handler was in the external location.  I don't know if you'll agree, but my fix was to change the last line of the getRegisteredHandler() method to recurse back into itself with the newly overridden handler and method and repeat all of its logic on the new event.  This would also make it possible for your onInvalidEvent to be part of a module as well.

Changed last line of getRegisteredHandler from this (with new comment):
// onInvalidEvent detected, so just return the overriden bean
return handlerBean;

To this...
// onInvalidEvent detected, so start over with the overriden handler and method
return getRegisteredHandler(handlerBean.getHandler() & "." & handlerBean.getMethod()); 

I can create a GIT pull request for this, but please be patient-- I've been so busy I still haven't done so with my last suggestion :)

Thoughts?

Thanks!

~Brad

Luis Majano

unread,
Jan 19, 2011, 5:36:17 PM1/19/11
to col...@googlegroups.com
Hi Brad,

I think this is a winner.  I will add this tonight.

Yea take yoiur time, you will see how fun it is to collaborate with git.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com


--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Luis Majano

unread,
Jan 19, 2011, 11:08:23 PM1/19/11
to col...@googlegroups.com
Brad,

Did you revise using the latest on github or RC1?

-- 

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Brad Wood

unread,
Jan 19, 2011, 11:19:02 PM1/19/11
to col...@googlegroups.com
RC1.

Luis Majano

unread,
Jan 19, 2011, 11:21:16 PM1/19/11
to col...@googlegroups.com
Can you check latest I completely reworked it.

Brad Wood

unread,
Jan 19, 2011, 11:40:45 PM1/19/11
to col...@googlegroups.com
Sure thing.

Sorry to still be hitting RC1 so much. We're still on it at work, so its
the version in front of me most of the day. I'm hoping to start running RC2
on dev after it comes out.

~Brad

br...@bradwood.com

unread,
Jan 28, 2011, 4:49:23 PM1/28/11
to ColdBox Platform
Luis, I just tested this with the latest on github, and it looks like
the problem is still there.

I tried my suggested change that I made on RC1 (changing out the last
line of getRegisteredHandler()) and that fix still works so I would
recommend adding it in for RC2.

Thanks!

~Brad

Luis Majano

unread,
Jan 29, 2011, 12:40:45 PM1/29/11
to col...@googlegroups.com
Brad can you remind me of this, I am lost of the problem and solution. I want to add this before I close rc2


-- 
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Brad Wood

unread,
Jan 29, 2011, 12:54:17 PM1/29/11
to col...@googlegroups.com
You can always just re-read the OP  :)
 
I tried to do a pull request for this last night, but Git is still kickin' my butt.  I've cloned the main coldbox repo as well as my fork.  I got the nightly running locally, and made several changes to my fork, but I'm a little confused about whether or not I do the pull request from my local PC, or if I have to commit the changes to git-hub and do the pull request from there.  The "commit" option is grayed out in eGit, so I must be missing something really obvious because it won't even let me commit.  *sigh*  Any help there would be appreciated.
 
~Brad
----- Original Message -----

ColdBox Manager

unread,
Jan 29, 2011, 12:54:31 PM1/29/11
to ColdBox Platform
I believe you have to commit and then push to github on your own
fork. Then once pushed, you can go to github and send me a pull
request for it. Also, I needed a revision of the code since you
looked at rc1 and not the latest, so I really don't know the issue
location anymore.

Hope this helps.

On Jan 29, 9:54 am, "Brad Wood" <b...@bradwood.com> wrote:
> You can always just re-read the OP  :)http://groups.google.com/group/coldbox/browse_thread/thread/cad78b964...
>
> I tried to do a pull request for this last night, but Git is still kickin' my butt.  I've cloned the main coldbox repo as well as my fork.  I got the nightly running locally, and made several changes to my fork, but I'm a little confused about whether or not I do the pull request from my local PC, or if I have to commit the changes to git-hub and do the pull request from there.  The "commit" option is grayed out in eGit, so I must be missing something really obvious because it won't even let me commit.  *sigh*  Any help there would be appreciated.
>
> ~Brad
>
>
>
>
>
>
>
>   ----- Original Message -----
>   From: Luis Majano
>   To: col...@googlegroups.com
>   Sent: Saturday, January 29, 2011 11:40 AM
>   Subject: [coldbox:7891] Re: Missing event handler in external location
>
>   Brad can you remind me of this, I am lost of the problem and solution. I want to add this before I close rc2
>
>   --
>   Luis F. Majano
>   President
>   Ortus Solutions, Corp
>
>   ColdBox Platform:http://www.coldbox.org
>   Linked In:http://www.linkedin.com/pub/3/731/483
>   Blog:http://www.luismajano.com
>   IECFUG Manager:http://www.iecfug.com
>
>   On Friday, January 28, 2011 at 1:49 PM, b...@bradwood.com wrote:
>
>     Luis, I just tested this with the latest on github, and it looks like
>     the problem is still there.
>
>     I tried my suggested change that I made on RC1 (changing out the last
>     line of getRegisteredHandler()) and that fix still works so I would
>     recommend adding it in for RC2.
>
>     Thanks!
>
>     ~Brad
>
>     On Jan 19, 10:21 pm, Luis Majano <lmaj...@gmail.com> wrote:
>
>       Can you check latest I completely reworked it.
>
>     --
>     You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
>     To post to this group, send email to col...@googlegroups.com
>     To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
>     For more options, visit this group athttp://groups-beta.google.com/group/coldbox
>     For News, visithttp://blog.coldbox.org
>     For Documentation, visithttp://wiki.coldbox.org

Brad Wood

unread,
Jan 29, 2011, 1:26:29 PM1/29/11
to col...@googlegroups.com
> I believe you have to commit and then push to github on your own fork. 
 
Yeah, that's what it's not letting me do.  I know you're not familiar with eGit so I'm hoping someone else will chime in, but I made the changes to my fork, but when I right click and go to "team", the "commit..." menu item is grayed out with no explanation.  Kind of frustrating really.  (I tried googling for a bit for "egit commit is grayed out" and "egit can't commit" with no immediate success.)
 
> Also, I needed a revision of the code since you looked at rc1 and not the latest, so I really don't know the issue location anymore.
 
Well, I compared the version of RC1 and the nightly last night and honestly there's not too much different in the file.  Mostly removal of cfargument types (what's up with that anyway) and swapping getSetting for instance variables.  The last line of the method I changed actually hadn't changed at all, so applying my fix to the nightly was the exact same as it was for RC1.  The code I pasted in the original post that is the last two lines of getRegisteredHandler from RC1 is still the same code on the nightly so it should be easy to find.
 
Thanks!
 
~Brad

Peter Bell

unread,
Jan 29, 2011, 3:00:55 PM1/29/11
to col...@googlegroups.com
Try command line git. You really need to start with cli. Maybe you cloned read only repo? Try git push with cli and see what it says.

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com

Brad Wood

unread,
Jan 29, 2011, 3:33:21 PM1/29/11
to col...@googlegroups.com
Try command line git. You really need to start with cli.
 
Thanks for the help Peter.  Pardon my ignorance, but I have absolutely no clue how to access the command line for Git.  All I know is I installed the eGit plug-in into ColdFusion Builder and now I have a Git perspective.  Do I access the command line via Eclipse or do I have to open a DOS window, CD to a dir, and start banging away?
 
Maybe you cloned read only repo?
 
That's possible.  How do I tell?  I connected to my fork with my username and password from github using the HTTPS url?  Is there a setting in github to make a repo read-only, or is it all based on the URL you use?
 
Try git push with cli and see what it says.
Ok, and to confirm, unlike SVN, committing doesn't push anything to the remote repo, it just commits it "locally", right? 
 
Thanks again for the help.  I feel like such a newb trying to figure this out!
 
~Brad

Peter Bell

unread,
Jan 29, 2011, 4:47:56 PM1/29/11
to col...@googlegroups.com
Hey brad, on iPhone so gonna be brief. Go to github, read the help docs. It's really worth investing a couple of hours learning git and the command line is required to 'get' it. 

Sent from my iPhone
--

br...@bradwood.com

unread,
Feb 4, 2011, 3:00:21 PM2/4/11
to ColdBox Platform
OK, I'm still wading through the new Git stuff. I have managed to
commit this to my local Git repo and push it to my fork on GitHub and
created a pull request. (Yay!)
https://github.com/ColdBox/coldbox-platform/pull/21

I have two other unrelated pull requests I would like to make, but
apparently I can only have one pull request at a time. Would I have
to make multiple forks on github to submit more than a single pull
request?

I guess once we figure this one out, I'll move on to the next. Thanks
for the Github help so far everyone.

Thanks!

~Brad

On Jan 29, 3:47 pm, Peter Bell <li...@pbell.com> wrote:
> Hey brad, on iPhone so gonna be brief. Go to github, read the help docs. It's really worth investing a couple of hours learning git and the command line is required to 'get' it.
>
> Sent from my iPhone
>
> On Jan 29, 2011, at 3:33 PM, "Brad Wood" <b...@bradwood.com> wrote:
>
> > Try command line git. You really need to start with cli.
>
> > Thanks for the help Peter.  Pardon my ignorance, but I have absolutely no clue how to access the command line for Git.  All I know is I installed the eGit plug-in into ColdFusion Builder and now I have a Git perspective.  Do I access the command line via Eclipse or do I have to open a DOS window, CD to a dir, and start banging away?
>
> > Maybe you cloned read only repo?
>
> > That's possible.  How do I tell?  I connected to my fork with my username and password from github using the HTTPS url?  Is there a setting in github to make a repo read-only, or is it all based on the URL you use?
>
> > Try git push with cli and see what it says.
> > Ok, and to confirm, unlike SVN, committing doesn't push anything to the remote repo, it just commits it "locally", right?
>
> > Thanks again for the help.  I feel like such a newb trying to figure this out!
>
> > ~Brad
> > --
> > You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
> > To post to this group, send email to col...@googlegroups.com
> > To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages