Railo WAR: The event handler: railo.dspHome is not valid registered event

Hi guys,

i have some problems running ColdBox with the latest Railo version.
I deployed Railo WAR on Tomcat 6 using contextpath /railo

Then i created a /coldbox mapping to my coldbox folder.
At this point i can run the samples with http://localhost/railo/coldbox/samples
<-- works fine

For my source code folder i created a /cfml mapping and places a
sample app (cfportal) under this folder (i copied the
ApplicationTemplate folder for that).

When i try to access http://localhost/railo/cfml/cfportal/index.cfm i
get the following exception:

Application Execution Exception
Error Type: Framework.EventHandlerNotRegisteredException : [N/A]
Error Messages: The event handler: railo.dspHome is not valid
registered event.

The problem is, that the event is railo.dspHome. But it should be
general.dspHome.
When i copy the handler cfc general.cfc to railo.cfc all works fine.

Why is this happening?? Is it a bug or am I doing something wrong??

FYI: The same source code works with Adobes ColdFusion 8 Server.

Hi,

Check your DefaultEvent Setting in coldbox.xml.cfm

Make sure you have an event handler named railo.cfc and an event
method named dspHome.

I´m using coldbox version 2.5.1.
Default event in coldbox.xml.cfm: general.dspHome
So it should call the general handler (handlers/general.cfc) and run
the dspHome method (by the way, when i copy default.cfc into a new
file railo.cfc it works, but that is no solutions)

Problem is, that the "general" part of the handle is somewhere
translated into railo (my context path: http://localhost/railo/cfml/cfportal/index.cfm)

Diving a little bit deeper into the code:

In coldbox/system/coldbox.cfc i added two cfdumps (it is about line
120):

<cfdump
var="#cbController.getRequestService().getContext().getCurrentHandler()#">
<!--- Execute preProcess Interception --->
<cfset
cbController.getInterceptorService().processState("preProcess")>
<cfdump
var="#cbController.getRequestService().getContext().getCurrentHandler()#">

which shows the following output:

string general <-- output of the first cfdump
string railo <-- output of the second cfdump

So i followed the code to the interceptorService.cfc and there i
debugged the processState() method:

When i comment out this line (about line 100), everything works fine:
<cfset structFind( getinterceptionStates(),
arguments.state).process(event,arguments.interceptData)>

Any idea at this point?

Sorry, typo error:

it should be:
... (by the way, when i copy general.cfc into a new file railo.cfc it
works ...

And for further questions about the config ... it is the default
config and folder structure from the ApplicationTemplate folder of the
coldbox distribution.
The only things i changed are:

<cfset this.name = "cfportal"> in Application.cfc of my appfolder

and

<Setting name="AppName" value="cfportal"/> in the coldbox.xml.cfm

delete <cfset this.name = "cfportal"> in Application.cfc
leave it to the default <cfset this.name =
hash(getCurrentTemplatePath())>

did you reinit the framework?
index.cfm?event=railo.dspHome&fwreinit=1

Hmm, problem solved.

SES Interceptor ... no idea what it actually does, but changing the
courses in config/routes.cfm to ...

<cfset addCourse("/railo/:handler/:action/:id")>
<cfset addCourse("/railo/:handler/:action")>
<cfset addCourse("/railo/:handler")>

... brings the right result to my browser.

Thanks for support

:slight_smile:

Then I recommend you hit the guides and read them up. The ses guide will show you what they are for and how they translate, also, how to use them. ITS VERY IMPORTANT TO UNDERSTAND THE CUSTOM ROUTING SYSTEM. If not you will hit brick walls.

Hi,
I am still not convinced that changing routes.cfm is solved your
problem.

As you mention about dump info... still something is wrongly
configured...
Which I feel that you have some kind of global mapping pointing to
railo or cfml directory.

CF app should run within their own space... should not rely on long
route to figure out the app path.

Would you make sure how many mapping in cf-admin and where they
pointing to.....?

Let's have a example how to configure a web-apps!

/railo this main-directory

/railo/ColdBox (cf-mapping /coldbox)

/railo/MyApp1 | (if you need mapping then /
MyApp1Mapping ---> /railo/MyApp1)
/railo/MyApp2 | =
/railo/MyApp3 | =

If you have a cf-mapping /MyApp1Mapping ---> /railo directory then
there would be many issues

Thanks