Blank screen of death when adding listener

84 views
Skip to first unread message

Amine Sadry

unread,
May 13, 2012, 9:24:38 AM5/13/12
to Mach-II for CFML
Hi guys,

I am a newbie MachII user, I've just instaled MachII 1.9 on railo
3.3.3 and coldfusion 9; but I am having a hard time figuring out why i
get a blank screen when I add a listener in the skeleton. even with
sampleListener inthe skeleton, when i uncomment it in mach-ii.xml i
get the blank screen. when I comment the listener I get the view for
the default event correcty.


here is some data from my xml config file (i put here just what used
and not commented):
** the problem occure when i add the ligne <listener
name="LoginListener" type="listeners.LoginListener" /> or <listener
name="SampleListener" type="listeners.SampleListener">

Coud you please help me with that? thank you in advance

Regards,
Amine


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mach-ii PUBLIC "-//Mach-II//DTD Mach-II Configuration 1.9.0//
EN"
"http://www.mach-ii.com/dtds/mach-ii_1_9_0.dtd" >

<mach-ii version="1.9">

<!-- PROPERTIES -->
<properties>
<property name="applicationRoot" value="/" />
<property name="defaultEvent" value="sayHello" />
<property name="eventParameter" value="event" />
<property name="parameterPrecedence" value="form" />
<property name="maxEvents" value="10" />
<property name="exceptionEvent" value="exception" />
</properties>

<!-- LISTENERS -->
<listeners>

<!-- <listener name="SampleListener"
type="listeners.SampleListener">
<parameters>
<parameter name="yourParameterName" value="yourParameterValue" />
</parameters>
</listener> -->

<listener name="LoginListener" type="listeners.LoginListener" />
</listeners>


<!-- EVENT-HANDLERS -->
<event-handlers>
<event-handler event="sayHello" access="public">
<!-- <notify listener="SomeListener" method="doSomething"
resultArg="resultOfSomething" /> -->
<view-page name="home" />
</event-handler>

<event-handler event="exception" access="public">
<view-page name="exception" />
</event-handler>
</event-handlers>


<!-- PAGE-VIEWS -->
<page-views>

<page-view name="home" page="/views/home.cfm" />
<page-view name="loginForm" page="/views/login.cfm" />
<page-view name="userList" page="/views/userList.cfm" />
<page-view name="exception" page="/views/exception.cfm" />

</page-views>

Matthew Woodward

unread,
May 13, 2012, 3:52:24 PM5/13/12
to mach-ii-for...@googlegroups.com
On Sun, May 13, 2012 at 6:24 AM, Amine Sadry <amine...@gmail.com> wrote:
here is some data from my xml config file (i put here just what used
and not commented):
** the problem occure when i add the ligne  <listener
name="LoginListener" type="listeners.LoginListener" /> or <listener
name="SampleListener" type="listeners.SampleListener">

Sorry to ask the obvious, but do either of those listeners actually exist?

And just so I'm sure I understand, you're saying even if you don't actually have any <notify listener .../> stuff in your XML, just having the listener declared in the <listeners> block causes there to be a white screen with no additional information?

Does your exception view have anything in it?

Typically if there's problem with the listener (doesn't exist or has syntax errors) you'd see an error related to not being able to load the listener.

And you've restarted your CFML engine(s)?

--
Matthew Woodward
ma...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Amine Sadry

unread,
May 13, 2012, 4:27:33 PM5/13/12
to Mach-II for CFML
Hi Matthew,

Thank you for taking time to help me with that. Actually it's very
strange, I get the blank just by adding the listener declaration
without having any <notify.., at first i thought maybe it's a bug on
railo or something and i tested with coldfusion...but it doesnt work

to answer your question, yes the exception view has the default code
of skeleton

i have just tried again with a very basic application, and restarting
CFML engine:

=== FIRST TEST ===
1) I copy the skeleton from MachII 1.9 folder and rename it helloMach
2) I change xml config property :
<property name="applicationRoot" value="/" />
3) and i test it, it works i have the default home view of skeleton
saying "Skeleton Installation Success!..."


=== SECOND TEST ====
1) I add a listener declation to the one existing in skeleton
listeners folder,
so I change :
<!--
<listener name="yourListenerName"
type="fully.Qualified.Dot.Delimited.Path.To.CFC">
<parameters>
<parameter name="yourParameterName" value="yourParameterValue" />
</parameters>
</listener>
-->
To:
<listener name="SampleListener"
type="listeners.SampleListener">
<!--<parameters>
<parameter name="yourParameterName" value="yourParameterValue" />
</parameters>-->
</listener>


2)I test again, and i get the blank screen, without any error message
( i checked again the exception view and it content some code inside
to display variables.exception stuff)


I don't see what i did wrong to have a blank screen without any error
message, it's quite bizzard :)

Thanks again for your help

Amine


On 13 mai, 21:52, Matthew Woodward <m...@mattwoodward.com> wrote:
> On Sun, May 13, 2012 at 6:24 AM, Amine Sadry <amine.sa...@gmail.com> wrote:
> > here is some data from my xml config file (i put here just what used
> > and not commented):
> > ** the problem occure when i add the ligne  <listener
> > name="LoginListener" type="listeners.LoginListener" /> or <listener
> > name="SampleListener" type="listeners.SampleListener">
>
> Sorry to ask the obvious, but do either of those listeners actually exist?
>
> And just so I'm sure I understand, you're saying even if you don't actually
> have any <notify listener .../> stuff in your XML, just having the listener
> declared in the <listeners> block causes there to be a white screen with no
> additional information?
>
> Does your exception view have anything in it?
>
> Typically if there's problem with the listener (doesn't exist or has syntax
> errors) you'd see an error related to not being able to load the listener.
>
> And you've restarted your CFML engine(s)?
>
> --
> Matthew Woodward
> m...@mattwoodward.comhttp://blog.mattwoodward.com

Matthew Woodward

unread,
May 13, 2012, 4:38:01 PM5/13/12
to mach-ii-for...@googlegroups.com
On Sun, May 13, 2012 at 1:27 PM, Amine Sadry <amine...@gmail.com> wrote:
=== SECOND TEST ====

            <listener name="SampleListener"
type="listeners.SampleListener">
                       <!--<parameters>
                               <parameter name="yourParameterName" value="yourParameterValue" />
                       </parameters>-->
               </listener>

Well, you shouldn't get a blank screen even if this is the case, but does that listener exist and is its syntax valid?

Also this shouldn't matter but try deleting the parameters block altogether as well as the closing listener tag and see if just this works:
<listener name="SampleListener" type="listeners.SampleListener" />

And again just to eliminate this possibility, make sure the listener exists.

The only other thing I can think to check is your application name in Application.cfc in the skeleton. Change that to something unique, and restart everything (your entire servlet container) after you do that to make sure everything's cleared out.

Kinda grasping at straws here without knowing more about your setup but see if any of these suggestions get you any further.

--
Matthew Woodward
ma...@mattwoodward.com

Matthew Woodward

unread,
May 13, 2012, 4:39:17 PM5/13/12
to mach-ii-for...@googlegroups.com
Another thing to consider is how you have your virtual hosts configured. Is '/' the correct value for your host's root, or do you have a context path in the mix (e.g. http://localhost:8080/railo for example)?

--
Matthew Woodward
ma...@mattwoodward.com

Amine Sadry

unread,
May 13, 2012, 5:00:49 PM5/13/12
to mach-ii-for...@googlegroups.com
no context for my virtual host,  the url is http://localhost:8888/helloMach/

1) i changed lister declaration to :
           <listener name="SampleListener" type="listeners.SampleListener" />

2) the listener exists in the folder listeners/SampleListener.cfc

3) I check listener code :

 <cfcomponent
displayname="SampleListener"
extends="MachII.framework.Listener"
output="false"
hint="A simple listener example.">

with 2 functions: "configure" and "sampleFunction" that do nothing

4) In Application.cfc i put helloMach in app name:

<cfcomponent
displayname="helloMach"
extends="MachII.mach-ii"
output="false">

<cfset this.name = "helloMach" />

5) Restart Railo

=== First Test===
Blank screen

=== Second Test===
I comment listener in config file:
<!-- <listener name="SampleListener" type="listeners.SampleListener" /> -->

I get the default home view 

It seems it's really about xml file declaration, i do not know what's wrong with it :s

Amine

Matthew Woodward

unread,
May 13, 2012, 5:39:01 PM5/13/12
to mach-ii-for...@googlegroups.com
On Sun, May 13, 2012 at 2:00 PM, Amine Sadry <amine...@gmail.com> wrote:
no context for my virtual host,  the url is http://localhost:8888/helloMach/

I have no idea what all you have set up on your machine, but the root of that application would be /helloMach not /

Amine Sadry

unread,
May 13, 2012, 6:16:19 PM5/13/12
to mach-ii-for...@googlegroups.com
Actually i put my apps in webapps folder of tomcat (D:\dev\bin\railo\tomcat\webapps) and with this configuration it works with "/" as root not "  /helloMach "

I moved the app to ROOT folder (D:\dev\bin\railo\tomcat\webapps\ROOT\helloMachBis) and with this configuration it works with "/helloMachBis" as root not "/"
AND I have no more Blank screen, Yeaaaaaah :) 

it's seems working correctly without any change, just put the app folder in ROOT folder

I didnt get why my app doesnt work correctly in webapps folder but anyway i will investigate this point and understand more MachII config

THANKS A LOT FOR YOUR HELP Matt :)

Amine,

Matthew Woodward

unread,
May 13, 2012, 6:24:45 PM5/13/12
to mach-ii-for...@googlegroups.com
On Sun, May 13, 2012 at 3:16 PM, Amine Sadry <amine...@gmail.com> wrote:
Actually i put my apps in webapps folder of tomcat (D:\dev\bin\railo\tomcat\webapps) and with this configuration it works with "/" as root not "  /helloMach "

But if you don't do any additional configuration, and you're not running in the ROOT context, then you're definitely going to have a context in the mix.
 

I moved the app to ROOT folder (D:\dev\bin\railo\tomcat\webapps\ROOT\helloMachBis) and with this configuration it works with "/helloMachBis" as root not "/"
AND I have no more Blank screen, Yeaaaaaah :) 

Right, that makes sense. If it wasn't in ROOT you'd have to do http://localhost:8888/context/helloMach and adjust your root in the config files accordingly.

I didnt get why my app doesnt work correctly in webapps folder but anyway i will investigate this point and understand more MachII config

It's because (from what you're saying) you had a context path in the mix. That's why it works from ROOT.

Don Aminos

unread,
May 13, 2012, 6:31:26 PM5/13/12
to mach-ii-for...@googlegroups.com
Oki oki, thank you for this explanation ;)

Nicholas Dee

unread,
May 15, 2012, 11:09:19 AM5/15/12
to mach-ii-for...@googlegroups.com
We have our Listeners call our Managers and our Managers call the Gateways,Dao's or Cruds.
To simplify this i'll just refer to Gateways.
 
So if we have a AccountManager, BillManager and the respective AccountGateway and BillGateway .
 
The question is, if the AccountManager needs to call a method in the BillGateway should the AccountManager call the Billgateway directly
or should the AccountManager call the proper method in the BillManager and have the BillManger call the BillGateway?
 
Thanks for any responses.

Peter Farrell

unread,
May 15, 2012, 3:02:13 PM5/15/12
to mach-ii-for...@googlegroups.com

Call the manager not the gateway. This way if you gateway stuff changes...everything is done via the manager. One one place to fix. Otherwise you have to hunt for any external calls to gateways.

--
To post to this group, send email to mach-ii-for...@googlegroups.com
For more options and to unsubscribe, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en
 
SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/

Joe Bodell

unread,
May 15, 2012, 4:45:59 PM5/15/12
to mach-ii-for...@googlegroups.com
As an architectural practice, though....if the AccountManager has a reason to know about the Bill entity (table, whatever) ... IMHO the AccountManager should have a reference to the BillGateway so it can call it "natively", and you may not even need a BillManager ... this way your service/manager layer is acting as a better API for the "outside" world (i.e., Mach-ii or other clients) to understand how the data is actually organized. If you have services/managers calling each other, then managing those dependencies could get tough quickly. Instead, if you simply have one service/manager for one OR MORE related DAOs/tables/whatever, then to the outside world accessing your data becomes simpler, and your service/manager layer is a bit more purposeful.

^^^ $0.02.

--Joe
Reply all
Reply to author
Forward
0 new messages