Custom Error Message for Business Component

Custom Error Message for Business Component

In my previous post, I had explained how to Display Custom error message to user to extend DCErrorHandlerImpl and register to Databinding.cpx file.

Well, there’s another way to do the same. Follow these steps…

  1. Rigth Click on Model Project and select project properties
  2. Then select “Option” under Business Component
  3. To add custom message bundle class for your project, click New and add bundle Class.
  4. Now MyCustomBundle class is generated by framework which extends ListREsourceBundle as follows
    import java.util.ListResourceBundle;
    public class MyMessageBundle extends ListResourceBundle {
    private static final Object[][] sMessageStrings = new String[][] {
    {"25013","Duplicate Employee Id Found."}
    /**Return String Identifiers and corresponding Messages in a two-dimensional array.    */
    protected Object[][] getContents() {
    return sMessageStrings;
  5. Edit the two-dimensional String array “sMessageStrings” in the custom message bundle class to add your custom message. In this example I’m writing custom message for error code.
    “25013 – To many Object match the primary key” when duplicate record found.
  6. Therefore, I just add my custom message for that
    private static final Object[][] sMessageStrings = new String[][] {
    {"25013","Duplicate Employee Id Found."}
  7. Run Application Module, create new row in Employee ViewObject with same EmployeeId that already exist and display your own custom message to the user.
  • image001
  • image002
  • image003
  • image004

About Manish Pandey

Manish is a Project Leader at Jagran Prakashan Ltd, focused on Jdeveloper Fusion Web Application(specifically Oracle ADF). He shares his knowledge through the OTN Jdev/ADF Forum. He has written more than 50 article about Oracle ADF and Jdeveloper.

Leave a Reply

Your email address will not be published. Required fields are marked *


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