Global Error Handling Mechanism
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
Global Error Handling Mechanism  XML
Forum Index -> General Help Go to Page: 1, 2 Next 
Author Message
pandian

Joined: 10/11/2006 00:00:00
Messages: 27
Offline


Hi,

Does iceFaces have any equivalents of Struts's Exception handling mechanism like Local/Global Exception that can configured in the struts-config.xml and struts will redirtect respective pages on error?

I tried to look around in the web and someone suggested creating a Proxy servlet which will instantiate the Faces Servlet and calls Faces's service method with a try-catch block to handle exception. Apparently, this proxy servlet solution doesn't seem to work with icefaces jsf/facelet.

So, we had put a global navigation rule as seen below. We catch exceptions inside the backing bean methods and return the "error" incase of any exception that can't be handled. This displays the error.jsp to the user in the browser. But, the problem with this approach is that when an error happens during initial launch of the page (i.e before the backing bean is instantiated), we have no control over the Exceptions that may happen.

Is there any other better solution that will handle all Excpetion including the ones onload of the page?

Thanks.
Pandian.


<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>error</from-outcome>
<to-view-id>/error.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>


public String deleteListener()
{

String navigate = null;
try{


}
catch(Exception e)
{
navigate = "error";
session.setAttribute("exception", e);
}

if (navigate == null)
requestRender();

return navigate;
}
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


Hi Pandian,

If it's just a matter of hiding an exception from the user and showing a nice error page, I would just use the servlet spec's general error page mechansim.

Code:
<error-page>
     <exception-type>javax.servlet.ServletException</exception-type>
     <location>/servlet/ExceptionHandlerServlet</location>
 </error-page>


Thanks,
Philip

.
pandian

Joined: 10/11/2006 00:00:00
Messages: 27
Offline


Hi Philip,

I have configured it on my web.xml in addition to my error handling mechanism. Error page configured here never showed up until this time.

Let you know if this actually helped.

Thanks.
Pandian.
venkata.ravuri

Joined: 06/09/2006 00:00:00
Messages: 2
Offline


Is this problem resloved?

Hi All,

We have a similar problem. We need to redirect user to an error page when a backing bean throws unchecked exception. How does unchecked exceptions such as IllegalArgumentException and ArrayIndexOutOfBoundException are handeled by ICEfaces. ICEfaces is blocking exceptions thrown by backing bean methods.

Following are different ways we tried to resolve this issue,
1) Included <error-page> tag in web.xml,
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsp</location>
</error-page>
This option is of no use!

2) We tried to override BlockingServlet. As we cannot override renderCycle method, It also not useful for this context.

Please suggest us the way forward on this issue?

Regards,
Venkata S. Ravuri

philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


Hi Venkata,

This bug has been logged. we'll update you when we know more about the issue.

Thanks,
Philip

.
srbartlett

Joined: 29/01/2007 00:00:00
Messages: 10
Offline


Hi Philip,

Regarding the bug that was logged, please can you provide an update on its status.

I really hope iceFaces provides an exception handling framework. Without it the only option I have is to catch runtime exceptions in backing beans which isn't something I like.

Do you have any other suggestions?

cheers,
steve.
danmei

Joined: 01/12/2006 00:00:00
Messages: 14
Offline


Hello

Same problem here... with Icefaces 1.5.3

Is there any workaround?

greetings
daniel


btw: which class is responsible to delegate an exception to the error page?
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2701
Offline


An update for those interested...we're still working on this issue, which is logged in http://jira.icefaces.org/browse/ICE-1133. Please feel free to add your comments to the case.

Philip

.
sendewelt

Joined: 04/09/2007 00:00:00
Messages: 47
Offline


hi philip,

how is it going with that issue?
i think many people would be interested in a solution to this problem.
the link you posted is dead.
is there anything new concerning gloabl error pages?


br,

Andreas Unterweger
nangwai

Joined: 02/12/2007 00:00:00
Messages: 2
Offline


Is there any update on this topic "Global Error Handling Mechanism"?
ramsreddy

Joined: 02/11/2009 00:00:00
Messages: 16
Offline


no updates till now on this topic somebody help
lomniczi

Joined: 20/10/2009 00:00:00
Messages: 9
Offline


Hi all,

I have the same problem. I tried the error page solution:

<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error500.jsp</location>
</error-page>

I generated an error in jspx page: I wrote wrong bean property, but error page solution did not work, I got this error:

Exception Processing ErrorPage[exceptionType=java.lang.Exception, location=/error500.jsp]
java.lang.IllegalStateException: PWC3991: getOutputStream() has already been called for this response

(see error.txt)

Furhermore, error page solution did not work at all in action listener methods of backing beans:

public void saveProp( ActionEvent event )
{
try
{
...
}
catch ( FacadeException fe )
{
logger.throwing( this.getClass().getName(), "saveProp", fe );
FacesContext context = FacesContext.getCurrentInstance();
context.responseComplete();
context.getApplication().getNavigationHandler().handleNavigation( context, null, "applicationError" );
}
}

I mapped applicationError to an error page but it was not shown.

If I used this code:

public void saveProp( ActionEvent event ) throws FacadeException
{
...
}

then I saw error in the log but error page it still was not shown.
Can anybody help me? Is there an usual exception handling overview document in Icefaces???
mpekarskij

Joined: 10/08/2009 00:00:00
Messages: 21
Offline


I have the same issue with error handling in actionListener methods.

Does anybody have solution?
mastaskillz33

Joined: 07/01/2010 00:00:00
Messages: 18
Offline


How come this is not in the developers guide?
mastaskillz33

Joined: 07/01/2010 00:00:00
Messages: 18
Offline


I forced a java.lang.ArithmeticException: in a ( ValueChangeEvent event ) method. Icefaces just buries the exception. How can I get it without catching throwable?
 
Forum Index -> General Help Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team