Skip to main content

Globally configuring ErrorHandlerClass for an ADF application

I talked about customizing the DCErrorHandlerImpl in one of my old blog post http://www.jobinesh.com/2011/03/customizing-business-components-error.html. This custom ErrorHandlerClass is usually configured in DataBindings.cpx file. What if you have many projects and you want to configure it centrally in one place at application level. From release version 11.1.2.1.0 onward ADF supports configuration of ErrorHandlerClass  in adf-config.xml (Thanks to Steve Muench who shared this tip). A sample adf-config.xml with custom error handler class is here:

<?xml version="1.0" encoding="windows-1252" ?>
<adf-config xmlns="http://xmlns.oracle.com/adf/config" xmlns:config="http://xmlns.oracle.com/bc4j/configuration"
            xmlns:adf="http://xmlns.oracle.com/adf/config/properties"
            xmlns:sec="http://xmlns.oracle.com/adf/security/config">
  <adf-adfm-config xmlns="http://xmlns.oracle.com/adfm/config">
    <defaults changeEventPolicy="ppr" useBindVarsForViewCriteriaLiterals="true"/>
    <startup errorHandlerClass="view.util.CustomDCErrorHandlerImpl">
      <amconfig-overrides>
        <config:Database jbo.locking.mode="optimistic"/>
      </amconfig-overrides>
    </startup>
  </adf-adfm-config>
  ... ... ...
</adf-config>

Comments

Renan Barbalho said…
Hello,
First congratulations for your post, it's very nice!
I've a ADF Mobile application and I want define a global exception handler but I don't know how!
I tried to configure like your article but when an exception is generated the exception handler class didn't invoke.
Do you have any idea to solve this question?

Regards,
Renan
Renan Barbalho said…
Dear,
Can you post your class view.util.CustomDCErrorHandlerImpl?
See this link http://docs.oracle.com/middleware/1212/adf/ADFFD/bcadvgen.htm#ADFFD23461
btw, this for ADF Web
Renan Barbalho said…
Dear Jobinesh,
And Global Error Handler to ADF Mobile, do you know how to do this?

I need to put this in my application. I have a big application based on the adf mobile.
I work with oracle spatial, mapviewer, oraclemaps, adf web, adf desktop. My company has projects that use oracle technology and we're Oracle's Partner.
If you can help me I'll be very happy. If necessary I can to pass my project by email for you.

Regards,
Renan

Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…