Forum Stats

  • 3,826,865 Users
  • 2,260,714 Discussions
  • 7,897,108 Comments

Discussions

Display Custom Error Message in OIM 11g

user4173086
user4173086 Member Posts: 3
edited Oct 2, 2013 1:47PM in Identity Manager
Hi,

I'm trying to display an error message from a validation event handler but seems that am missing something. When the "oracle.iam.platform.kernel.ValidationFailedException" is thrown from a validation handler an error message is displayed: "An error occurred". If an error code is provided (see code below) then the message looks like: "An error occurred. The corresponding error code is ERR-0001". I guess that some resource bungle with corresponding messages should be provided.

the code used:

package test;

public class UserGeneralValidationHandler implements oracle.iam.platform.kernel.spi.ValidationHandler
{
...

@Override
public void validate(long processId, long eventId, Orchestration orchestration)
throws ValidationException
{
...
String errorCode = "ERR-0001";
String message = "Simple validation message.";

ValidationFailedException ex = new ValidationFailedException(message);
ex.setProcessID(processId);
ex.setErrorCode(errorCode);

throw ex;
}


Q:
1.What is missing for complete solution?
2.What is the algorithm that used by OIM to find default or non default resource bundle?
3.How to change out-of-box validation messages? For a sample "The organization ABC does not exist." message is shown if non existing organization is provided during user creation and I'd like to have a different one.


Regards
Serge

Answers

  • soverbosch
    soverbosch Member Posts: 23
    If you want to throw your own messages, please have a look at the agent...properties files in oracle/iam/request/agentry/resources in OIMUI.jar, you should do something like this in the code:

    String msg = "Note[PROBLEM].text:Problem has occurred:";
    throw new InvalidRequestDataException(msg);

    in all agent.properties files then you should define
    Note[PROBLEM].text=Problem has occurred
  • BikashBagaria
    BikashBagaria Member Posts: 1,699
    This might help: 9748595

    HTH,
    BB
  • 1025328
    1025328 Member Posts: 2
    edited Oct 2, 2013 1:47PM
    • rename OIMUI.jar  to OIMUI.zip
    • find logging_en and loggin.properties.
    • Modify the "IAM-2050512" error message with your custom message
    • Find Agent and agent_en.properties.
    • Find Note[ERROR_SUBMITTING_REQUEST].text.  Modify the message. Make sure the message must be the same with in logging.properties("IAM_2050512")

    Deploy

    • change the  OIMUI.zip to jar
    • replace the existing OIMUI.jar
    • login to weblogic  and redeploy OIM (oim.ear)

    no need to restart OIM server.

    Test:

    • create a request in web console again, you must see the custom message when you hit the submit button

    hope this helps.

    -rad

This discussion has been closed.