How to create your custom ExceptionHandler in Oracle ADF


  • Create a Java class that extends
  • Create a textfile with the name “” (without the quotes) and store it in .adfMETA-INFservices (you need to create the “services” folder)
  • In the file, add the absolute name of your custom exception handler class (package name and class name without the “.class” extension)


public class MyCustomExceptionHandler extends ExceptionHandler {

public MyCustomExceptionHandler() {
public void handleException(FacesContext facesContext, 
                            Throwable throwable, PhaseId phaseId) 
                            throws Throwable{
   String error_message;
   error_message = throwable.getMessage();
   //check error message and handle it if you can
   if( … ){  
       //handle exception
      //delegate to the default ADFc exception handler
       throw throwable;}

it is recommended to first try and handle exceptions with the ADF Controller default exception handling mechanism.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.