Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 62 Insurance
- 536.1K On-Premises Infrastructure
- 138.2K Analytics Software
- 38.6K Application Development Software
- 5.7K Cloud Platform
- 109.4K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.2K Integration
- 41.6K Security Software
Display Custom Error Message in OIM 11g

user4173086
Member Posts: 3
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
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
Tagged:
Answers
-
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 -
-
- 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.