myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gurkan Erdogdu (JIRA)" <>
Subject [jira] Created: (MYFACES-2796) org/apache/myfaces/shared/context/ # getRootCause(Throwalbe) not work correctly
Date Thu, 08 Jul 2010 08:38:49 GMT
org/apache/myfaces/shared/context/ # getRootCause(Throwalbe) not work

                 Key: MYFACES-2796
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.0
            Reporter: Gurkan Erdogdu

I throw exception from my EL method and handling exceptions with my custom exception handler.

//Exception class
public class MyException extends RuntimeException{

//Bean action method
//Using from #{bean.log} in a page
public String log(){
      throw new MyException();

I write custom exception handler with wrapped semantic.
public class MyExceptionHandler extends ExceptionHandlerWrapper{
         public void handle(){
			ExceptionQueuedEvent event =;
			ExceptionQueuedEventContext context = (ExceptionQueuedEventContext) event
			Throwable t = context.getException();
                        Throeable cause = getRootCause(t);  --> But it does not give MyException,
it gives ELEvaluationException!!!!

Probiem is that
 # getRootCause compare classes with equals(), but must use isAssignableFrom().
           //Current Implementation
           if (!clazz.equals(FacesException.class) && !clazz.equals(ELException.class))
                return t;
           //I think it must be
          if(!FacesException.isAssignableFrom(clazz) && !ELException.isAssignableFrom(clazz)){
             return t;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message