You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by ma...@accenture.com on 2007/05/30 15:44:28 UTC

No onException called

Hi, I have configure a my dialogContextListener but If I receive the
onEntry method call back (for example) but I don't receive any
onException in case I call a transition not setted in dialog config
file. In the log I found:

 

[30/05/07 15.39.09:854 CEST] 00000029 ActionListene E
it.accenture.web.myfaces.application.ActionListenerImpl processAction
error

                                 java.lang.IllegalStateException: Cannot
find transition 'Show Dati Generali' for state 'Dati Generali' of dialog
'prpcoll'

      at
org.apache.shale.dialog.basic.BasicDialogContext.transition(BasicDialogC
ontext.java)

      at
org.apache.shale.dialog.basic.BasicDialogContext.advance(BasicDialogCont
ext.java:381)

      at
org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(D
ialogNavigationHandler.java:138)

      at
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionLi
stenerImpl.java:82)

      at
it.accenture.web.myfaces.application.ActionListenerImpl.processAction(Ac
tionListenerImpl.java:67)

      at javax.faces.component.UICommand.broadcast(UICommand.java:109)

      at
org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem.
broadcast(HtmlCommandNavigationItem.java:291)

      at
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)

      at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:139)

      at
org.apache.shale.view.faces.ShaleViewRoot.processDecodes(ShaleViewRoot.j
ava:55)

      at
org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyReq
uestValuesExecutor.java:32)

      at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.ja
va:95)

      at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70
)

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)

 

Can you help me please?

Thanks in advance

Mario Buonopane

 



This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Re: No onException called

Posted by Rahul Akolkar <ra...@gmail.com>.
On 5/30/07, Craig McClanahan <cr...@apache.org> wrote:
> On 5/30/07, Rahul Akolkar <ra...@gmail.com> wrote:
> > On 5/30/07, mario.buonopane@accenture.com <ma...@accenture.com> wrote:
> > > Hi, I have configure a my dialogContextListener but If I receive the
> > > onEntry method call back (for example) but I don't receive any
> > > onException in case I call a transition not setted in dialog config
> > > file. In the log I found:
> > >
> > <snip/>
> >
> > The DialogContextListeners are notified on certain type of application
> > errors such as:
> >
> >  * Exception while executing the method binding expression associated
> > with an action state
> >  * Exception while trying to instantiate dialog data
> >
> > but are not notified on exceptions that have to do with either the
> > completeness of the dialog's "model" (such as the case here, an
> > unknown transition) or dialog lifecycle error conditions.
> >
> > I suspect it might have to do with the latter being perceived as
> > fatal. Craig will know.
> >
>
> In some sense, it is reasonable to think that the framework should
> report an intelligible error in such a case as this.  On the other
> hand, a hard core purist would say "stupid developer ... why are you
> trying to transition to a state that is not defined!" and say you
> should do unit tests to catch this kind of thing.  Both viewpoints
> have merit.
>
> My personal belief is that defining a transition to a state that is
> not defined is "pilot error" -- this is a mistake on the part of the
> developer who created the configuration file.  On the other hand, it
> would be nice if the framework provided a mechanism to validate the
> correctness of the configuration (seems like a nice RFE request) ...
> but I *strongly* believe that this is the kind of thing that should be
> validated at design time or build time, not at run time (where it
> would require extra overhead in the 99.9% of cases where the config
> file is actually correct).  Perhaps we could provide things like a
> command like tool to validate dialog configuration files for this sort
> of error.  This would also certainly fit in to the idea of a general
> 'configuration auditing' tool, which is the subject of an existing RFE
> (but I'm not in a position to figure out which one right now).
>
<snip/>

I think thats SHALE-388 [1] (some background in SHALE-382 [2] comments as well).

-Rahul

[1] http://issues.apache.org/struts/browse/SHALE-388
[2] http://issues.apache.org/struts/browse/SHALE-382


> > -Rahul
>
> Craig
>

Re: No onException called

Posted by Craig McClanahan <cr...@apache.org>.
On 5/30/07, Rahul Akolkar <ra...@gmail.com> wrote:
> On 5/30/07, mario.buonopane@accenture.com <ma...@accenture.com> wrote:
> > Hi, I have configure a my dialogContextListener but If I receive the
> > onEntry method call back (for example) but I don't receive any
> > onException in case I call a transition not setted in dialog config
> > file. In the log I found:
> >
> <snip/>
>
> The DialogContextListeners are notified on certain type of application
> errors such as:
>
>  * Exception while executing the method binding expression associated
> with an action state
>  * Exception while trying to instantiate dialog data
>
> but are not notified on exceptions that have to do with either the
> completeness of the dialog's "model" (such as the case here, an
> unknown transition) or dialog lifecycle error conditions.
>
> I suspect it might have to do with the latter being perceived as
> fatal. Craig will know.
>

In some sense, it is reasonable to think that the framework should
report an intelligible error in such a case as this.  On the other
hand, a hard core purist would say "stupid developer ... why are you
trying to transition to a state that is not defined!" and say you
should do unit tests to catch this kind of thing.  Both viewpoints
have merit.

My personal belief is that defining a transition to a state that is
not defined is "pilot error" -- this is a mistake on the part of the
developer who created the configuration file.  On the other hand, it
would be nice if the framework provided a mechanism to validate the
correctness of the configuration (seems like a nice RFE request) ...
but I *strongly* believe that this is the kind of thing that should be
validated at design time or build time, not at run time (where it
would require extra overhead in the 99.9% of cases where the config
file is actually correct).  Perhaps we could provide things like a
command like tool to validate dialog configuration files for this sort
of error.  This would also certainly fit in to the idea of a general
'configuration auditing' tool, which is the subject of an existing RFE
(but I'm not in a position to figure out which one right now).

> -Rahul

Craig

Re: No onException called

Posted by Rahul Akolkar <ra...@gmail.com>.
On 6/5/07, mario.buonopane@accenture.com <ma...@accenture.com> wrote:
> Rahul, every time I ask for something someone respond me ask me for a
> use case,
<snip/>

Sorry if it seems that way, but in this particular thread I think "the
larger picture" should drive any code changes, and I thought it'd be
better understood once we put some usecases on the table.

In other words, we could:

 o Define a new exception
     * As you indicate below
     * But I'm sure there are other error conditions (such as refering
to a non-existent state)
        - Should that be another exception type?
        - Should there be one generic "DialogException"?

 o Channel these errors via onException() callbacks (as you originally
seemed to suggest)
      * Should the dialog be determinated?
      * Should the dialog remain in the current state (and wait for
further input)?

So, some thought needs to be given to the design so we have a lasting
congruous solution for all types of dialog error handling. Code
changes can then quickly follow.


> but the point is:
> Why don't throw a framework-specific exception like
> "TransitionNotFoundException"?
> Is so horrible? In my point of view, if a framework throw specific
> exception would be a good idea... Craig told me the same think, so if
> you agree I can open an RFC.
>
<snap/>

Sure sounds like an option (and presumably works sufficiently well for
all your usecases as well). You don't need me to agree before you open
any RFC, please feel free to open any tickets at will ;-)

-Rahul


> However thanks for Shale and the time you spend for it!
>
> Mario
>
>

RE: No onException called

Posted by ma...@accenture.com.
Rahul, every time I ask for something someone respond me ask me for a
use case, but the point is:
Why don't throw a framework-specific exception like
"TransitionNotFoundException"?
Is so horrible? In my point of view, if a framework throw specific
exception would be a good idea... Craig told me the same think, so if
you agree I can open an RFC.

However thanks for Shale and the time you spend for it!

Mario 




-----Original Message-----
From: Rahul Akolkar [mailto:rahul.akolkar@gmail.com] 
Sent: 4 giugno 2007 22.05
To: user@shale.apache.org
Subject: Re: No onException called

On 6/4/07, mario.buonopane@accenture.com <ma...@accenture.com>
wrote:
> Rahul, some times ago Craig told me that the onException is the
correct
> way to catch and manage this exception:
> http://www.mail-archive.com/user@shale.apache.org/msg01111.html
>
<snip/>

The code will throw an IllegalStateException (as you've posted in the
top post in this thread), but won't result in an onException callback
in this scenario (I'm sort of interested in knowing what the scenarios
are -- other than developer error).

Obviously, I can't speak for Craig or anyone else, but I think his
response in this thread overrides that one by virtue of being more
recent.

-Rahul



> Mario
>
> -----Original Message-----
> From: Rahul Akolkar [mailto:rahul.akolkar@gmail.com]
> Sent: 30 maggio 2007 18.20
> To: user@shale.apache.org
> Subject: Re: No onException called
>
> On 5/30/07, mario.buonopane@accenture.com
> <ma...@accenture.com> wrote:
> > Hi, I have configure a my dialogContextListener but If I receive the
> > onEntry method call back (for example) but I don't receive any
> > onException in case I call a transition not setted in dialog config
> > file. In the log I found:
> >
> <snip/>
>
> The DialogContextListeners are notified on certain type of application
> errors such as:
>
>  * Exception while executing the method binding expression associated
> with an action state
>  * Exception while trying to instantiate dialog data
>
> but are not notified on exceptions that have to do with either the
> completeness of the dialog's "model" (such as the case here, an
> unknown transition) or dialog lifecycle error conditions.
>
> I suspect it might have to do with the latter being perceived as
> fatal. Craig will know.
>
> -Rahul
>


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Re: No onException called

Posted by Rahul Akolkar <ra...@gmail.com>.
On 6/4/07, mario.buonopane@accenture.com <ma...@accenture.com> wrote:
> Rahul, some times ago Craig told me that the onException is the correct
> way to catch and manage this exception:
> http://www.mail-archive.com/user@shale.apache.org/msg01111.html
>
<snip/>

The code will throw an IllegalStateException (as you've posted in the
top post in this thread), but won't result in an onException callback
in this scenario (I'm sort of interested in knowing what the scenarios
are -- other than developer error).

Obviously, I can't speak for Craig or anyone else, but I think his
response in this thread overrides that one by virtue of being more
recent.

-Rahul



> Mario
>
> -----Original Message-----
> From: Rahul Akolkar [mailto:rahul.akolkar@gmail.com]
> Sent: 30 maggio 2007 18.20
> To: user@shale.apache.org
> Subject: Re: No onException called
>
> On 5/30/07, mario.buonopane@accenture.com
> <ma...@accenture.com> wrote:
> > Hi, I have configure a my dialogContextListener but If I receive the
> > onEntry method call back (for example) but I don't receive any
> > onException in case I call a transition not setted in dialog config
> > file. In the log I found:
> >
> <snip/>
>
> The DialogContextListeners are notified on certain type of application
> errors such as:
>
>  * Exception while executing the method binding expression associated
> with an action state
>  * Exception while trying to instantiate dialog data
>
> but are not notified on exceptions that have to do with either the
> completeness of the dialog's "model" (such as the case here, an
> unknown transition) or dialog lifecycle error conditions.
>
> I suspect it might have to do with the latter being perceived as
> fatal. Craig will know.
>
> -Rahul
>

RE: No onException called

Posted by ma...@accenture.com.
Rahul, some times ago Craig told me that the onException is the correct
way to catch and manage this exception:
http://www.mail-archive.com/user@shale.apache.org/msg01111.html

Mario 

-----Original Message-----
From: Rahul Akolkar [mailto:rahul.akolkar@gmail.com] 
Sent: 30 maggio 2007 18.20
To: user@shale.apache.org
Subject: Re: No onException called

On 5/30/07, mario.buonopane@accenture.com
<ma...@accenture.com> wrote:
> Hi, I have configure a my dialogContextListener but If I receive the
> onEntry method call back (for example) but I don't receive any
> onException in case I call a transition not setted in dialog config
> file. In the log I found:
>
<snip/>

The DialogContextListeners are notified on certain type of application
errors such as:

 * Exception while executing the method binding expression associated
with an action state
 * Exception while trying to instantiate dialog data

but are not notified on exceptions that have to do with either the
completeness of the dialog's "model" (such as the case here, an
unknown transition) or dialog lifecycle error conditions.

I suspect it might have to do with the latter being perceived as
fatal. Craig will know.

-Rahul



>
>
> [30/05/07 15.39.09:854 CEST] 00000029 ActionListene E
> it.accenture.web.myfaces.application.ActionListenerImpl processAction
> error
>
>                                  java.lang.IllegalStateException:
Cannot
> find transition 'Show Dati Generali' for state 'Dati Generali' of
dialog
> 'prpcoll'
>
>       at
>
org.apache.shale.dialog.basic.BasicDialogContext.transition(BasicDialogC
> ontext.java)
>
>       at
>
org.apache.shale.dialog.basic.BasicDialogContext.advance(BasicDialogCont
> ext.java:381)
>
>       at
>
org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(D
> ialogNavigationHandler.java:138)
>
>       at
>
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionLi
> stenerImpl.java:82)
>
>       at
>
it.accenture.web.myfaces.application.ActionListenerImpl.processAction(Ac
> tionListenerImpl.java:67)
>
>       at javax.faces.component.UICommand.broadcast(UICommand.java:109)
>
>       at
>
org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem.
> broadcast(HtmlCommandNavigationItem.java:291)
>
>       at
>
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
>
>       at
> javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:139)
>
>       at
>
org.apache.shale.view.faces.ShaleViewRoot.processDecodes(ShaleViewRoot.j
> ava:55)
>
>       at
>
org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyReq
> uestValuesExecutor.java:32)
>
>       at
>
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.ja
> va:95)
>
>       at
>
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70
> )
>
>       at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
>
>
>
> Can you help me please?
>
> Thanks in advance
>
> Mario Buonopane
>
>


This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

Re: No onException called

Posted by Rahul Akolkar <ra...@gmail.com>.
On 5/30/07, mario.buonopane@accenture.com <ma...@accenture.com> wrote:
> Hi, I have configure a my dialogContextListener but If I receive the
> onEntry method call back (for example) but I don't receive any
> onException in case I call a transition not setted in dialog config
> file. In the log I found:
>
<snip/>

The DialogContextListeners are notified on certain type of application
errors such as:

 * Exception while executing the method binding expression associated
with an action state
 * Exception while trying to instantiate dialog data

but are not notified on exceptions that have to do with either the
completeness of the dialog's "model" (such as the case here, an
unknown transition) or dialog lifecycle error conditions.

I suspect it might have to do with the latter being perceived as
fatal. Craig will know.

-Rahul



>
>
> [30/05/07 15.39.09:854 CEST] 00000029 ActionListene E
> it.accenture.web.myfaces.application.ActionListenerImpl processAction
> error
>
>                                  java.lang.IllegalStateException: Cannot
> find transition 'Show Dati Generali' for state 'Dati Generali' of dialog
> 'prpcoll'
>
>       at
> org.apache.shale.dialog.basic.BasicDialogContext.transition(BasicDialogC
> ontext.java)
>
>       at
> org.apache.shale.dialog.basic.BasicDialogContext.advance(BasicDialogCont
> ext.java:381)
>
>       at
> org.apache.shale.dialog.faces.DialogNavigationHandler.handleNavigation(D
> ialogNavigationHandler.java:138)
>
>       at
> org.apache.myfaces.application.ActionListenerImpl.processAction(ActionLi
> stenerImpl.java:82)
>
>       at
> it.accenture.web.myfaces.application.ActionListenerImpl.processAction(Ac
> tionListenerImpl.java:67)
>
>       at javax.faces.component.UICommand.broadcast(UICommand.java:109)
>
>       at
> org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem.
> broadcast(HtmlCommandNavigationItem.java:291)
>
>       at
> javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
>
>       at
> javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:139)
>
>       at
> org.apache.shale.view.faces.ShaleViewRoot.processDecodes(ShaleViewRoot.j
> ava:55)
>
>       at
> org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyReq
> uestValuesExecutor.java:32)
>
>       at
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.ja
> va:95)
>
>       at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70
> )
>
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
>
>
>
> Can you help me please?
>
> Thanks in advance
>
> Mario Buonopane
>
>