Weblog

Using Fault Management Framework in Oracle 11g

The configuration of the fault management Framework for a SCA component has been made more flexible than it was in 10g. We can configure fault policies not only on composite level but also on component level. This enables us to configure retry policies not only on an error type and filter but also on specific components. To do this you just need two files:

You have to enable the fault policy by adding the files to your sca component, or you can add a reference in the sca component to hem, for example when they are placed in the mds.

fault-bindings.xml
Examples of fault-bindings.xml files can be found in oracle’s documentations:

fault-policies.xml
An detailed fault-policies.xml file can be found here.

Mediator
The Fault Management Framework is only applicable for mediators that processes their rules parallel, see documentation Fault Policies Mediator. If an error is matched in the fault policy an possible predefined fault action in the mediator will be ignored. Be aware of this when you are defining your fault policies and error handling.

Example
I have made a simple sca component to show the working of the framework. This sca component has two components {BPEL and Mediator} which are exposed as services to the outside world.

CompositeOverview

They will pass the message to a BPEL that throws a remote exception so we can test the working of the configured fault policies and bindings. In this case a simple available exception but in real it could be an custom defined Business exception to trigger the fault handling. We will see also the way to recover an BPEL instance and a Mediator instance.
RemoteExceptionBPEL

The fault-policies.xml that’s configured in this project
FaultPoliciesXml

This fault-bindings.xml that’s configured in this project
FaultBindingsXml
If you would like to define on component level the fault policies the fault-bindings.xml would look like this
FaultPoliciesXmlComponent

Testing the composite
We deploy the composite and test if all the instances are cached by the defined fault policy.

Mediator Routing
First i invoked the service that’s connected to the mediator routing.
InvokeMediatorRouting
De defined fault policy works fine because the instance is been marked recoverable. By clicking on the link ‘Recoverable’ you get a popup where you can modify the payload (if needed) and select a recover action.InvokeMediatorRoutingRecover

BPELRouting
Second i tested the service that’s connected to the BPELRouting component.
InvokeBPELRouting
We have here also the same link to recover this instance.
InvokeBPELRoutingRecover

That’s the end of a simple example to get started with the Fault Management Framework.

This example has been executed on
Fusion Middleware 11g (11.1.1.2.0)

Reference documentation

Share and Enjoy:
  • del.icio.us
  • Google Bookmarks
  • DZone
  • LinkedIn
  • SphereIt
  • StumbleUpon
  • Technorati

19 Responses to “Using Fault Management Framework in Oracle 11g”

  1. Anju Says:

    Hi,

    I have a faultpolicy for synchronous processes which calls custom java class which in turn calls a composite to perform some actions.After this the fault policy rethrows the error back to the faulted process.
    But if I do not catch the fault in the calling process, the error ahndling composite also rolls back. Is this a known issue or am I missing something?

    Thanks
    Anju

  2. Theo van Arem Says:

    Hi Anju,

    It sound that there is a fault in the configuration files. The re throw from the faulted process is this defined in the fault policy?

    Please note that the fault policy works on the links from composite to composite. I could not say what the the fault policy will do when you preform a service call in ‘Embeded java’ in a process. I assume that this will not be picked-up by the fault policy.

  3. Anju Says:

    Sorry I think I explained it wrong. By custom java class , I meant a custom java fault handler.
    This is invoked by the fault policy framework and logs the error. After that the framework rethrows the fault back. The contents of the action are as follows:

    Action id=”custom-fault-handler”
    javaAction className=”CustomFaultHandler” defaultAction=”ora-rethrow-fault”
    returnValue value=”OK” ref=”ora-rethrow-fault”

  4. Harry Says:

    Hi,I am new to BPEL. I am trying to define Fault Policy Framework.
    Can you pls provide both the XSDs as well.

  5. Theo van Arem Says:

    Hello Harry,

    do you mean the xsd for fault-policies.xml and fault-bindings.xml?

    I have supplied them in the post. Click on the xsd link next to the xml file.

    Theo

  6. Harry Says:

    Can you let me know the importance of these XSD- fault-bindings.xsd and fault-policies.xsd.
    I have mentione dthe schemaLocation but havent created any xsd. Still, it is working fine.

  7. Theo van Arem Says:

    I supplied the xsd files to see what you can configure in the policy.xml for example the different kind of RetryType you can specify.

    With this xsd you can check if your xml files are correctly specified.

    -Theo

  8. Harry Says:

    Thanx Theo.

    Can u pls help me on 1 more thing.
    In my BPEL, I am calling DB adapter to update the table. I want to throw exception if the row updated is 0.

    Pls suggest how to retrieve the no. of updated rows.

  9. Harry Says:

    Hi Theo,

    The above example is working fine when i use the namespace as mentioned in the figures. I am trying to change the “xmlns:tns” and “targetNamespace” in XSDs and “xmlns” attribute in both XMLs.
    After changing all these attributes to “http://www.harry.com/bpel/faultpolicy”, I am not able to see the BPEL in pending state. After execution, it is showing as faulted in EM.

    Pls suggest.

  10. Prabhanjan Says:

    Have you tried doing Mediator fault handling?
    It doesn’t work at my end for mediator.
    Please provide a usecase example for mediator fault handling.
    it doesn’t work at this point because the namespace http://schemas.oracle.com/mediator/faults doesn’t seem to work.
    It says, faultPolicy tag is not defined in schema.

  11. Theo van Arem Says:

    Hi Prabhanjan,

    as is writen in the documentation of Oracle Fault policies are applicable to parallel routing rules only. Are your Mediator rules processed parallel?

    Have you configured also your binding? You need to bind your fault policy to the composite or to specific Components.

  12. Theo van Arem Says:

    Hi Harry,

    Try to undeploy/ and deploy your component it could be that the server is cached your definition files and doesn’t see your changes.

  13. pavan Says:

    Hi..
    I am using 11.1.1.1.0.
    I am unable to recover the messages.. I mean in console it is not dispalying options for recovery actions, delete rejected messages etc.

    Is this only for versions after 11.1.1.1.0.
    Or am i doing wrong.
    Please let me know.

  14. pavan Says:

    forgot to tell..
    I implemented the same as Arem’s example.
    I have choosen all processes as synchronous and throwing remote fault in second bpel.

    Thanks

  15. Theo van Arem Says:

    Hello Pavan,

    to answer your first question it should also work on 11.1.1.0. To find the problem in your SCA comonent i can give you some check points:

    - Is there a instance created after invoking a endpoint?
    - Do you see the fault thrown in the BPELConsole?
    - It the fault policy and binding correctly definded?

    Try not to make the complete sca componente at once but build it step by step. First happy flow hellowworld bpel, then add exception check if you can see the exception shown in the console, the configure fault policy and binding to catch the exception and to define the policy to handle the exception in the way you want it to happen.

    Happy programming!!

  16. pavan Says:

    yeah.. thanks Arem..
    I did some mistake..
    It is working fine now.

    Thanks

  17. pavan Says:

    yeah.. thanks Arem..
    I did some mistake..
    It is working fine now.
    Here i have a doubt.. If i use sync process and if i choose humanintervention in my policy.. and if the person takes 2 days to perform recovery…is this sync process will wait or timed out??

    Thanks

  18. pavan Says:

    Hi…
    Can we handle rollback fault by using fault-policies. If yes please help me out.

    I tried by keeping below part in my fault-policies.

    It is not working.
    It is urgent

    Thanks

  19. Sundar Rajan Says:

    Hi,

    Can you please tell me how can i place the two files in MDS?

    Regards,
    Sundar

Leave a Reply

Technology