Friday, January 12, 2018

OIM: Create and deploy scheduled task

The following posts covers all aspects of developing and deploying a scheduled task in OIM and creating a scheduled job.

The post will cover the following tasks in detail:
>> How to create a scheduled task ?
>> How to package a scheduled task ?
>> How to deploy a scheduled task ? 
>> How to create a scheduled job ?

How to create a scheduled task
This includes the following items:
> Developing java class and creating jar file
> Creating plugin file
> Creating metadata file


Developing java class and jar files:
1. Create a java project in IDE of your choice
2. Import the following jars in your project class path:
common-logging.jar
eclipselink.jar
jrf-api.jar
oimclient.jar
spring.jar
wlfullclient.jar
3. Create a java class and extend the class oracle.iam.scheduler.vo.TaskSupport
4. You will have to implement the abstract methods of this class: execute, getAttributes and setAttributes
5. Don't worry about getAttributes and setAttributes. Remember, we are learning the basics and trying to get out first scheduled job up and running.
6. Execute method is what is called when the scheduled job is executed.
7. This method has an input argument as a HashMap, this map contains the value provided by you on the schedule job UI (The UI parameters are configured in an xml file, that we will see lator).
8. Implement your custom logic in this method:
      How to get the data from UI
String lookupName = (String) hashMap.get("Lookup Name");
      How to initializa API and write custom logic
       UserManager userManager = Platform.getService(UserManager.class);

       How to add custom logger
 Create LOGGER
 Add in logging.xml

  9. Create the jar file using IDE.

Creating plugin file: Always call it plugin.xml for ease of use
Create an xml file and change the bold parameters only, this file is self-explanatory. 

<?xml version="1.0" encoding="UTF-8"?>
  <oimplugins xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<plugins pluginpoint="oracle.iam.scheduler.vo.TaskSupport">
<plugin pluginclass= "com.rohit.st.demo.SchedulerDemo" version="1.0" name="SchedulerDemo"/>
</plugins>
   </oimplugins>

Creating metadata file: This goes in MDS datastore, so provide a business friendly name
Create an xml file and change the bold parameters only, this file is self-explanatory. 
<scheduledTasks xmlns="http://xmlns.oracle.com/oim/scheduler">
<task>
<name>SchedulerDemo</name>
<class>com.rohit.st.demo.SchedulerDemo</class>
<description>SchedulerDemo</description>
<retry>5</retry>
<parameters>
<string-param required="true" encrypted="false" helpText="Lookup Name">Lookup Name</string-param>
<string-param required="true" encrypted="false" helpText="First Name">First Name</string-param>
<string-param required="true" encrypted="false" helpText="Last Name">Last Name</string-param>
</parameters>
</task>
</scheduledTasks>

How to package a scheduled task
1. Create a directory (let us call is SchedulerDemo directory, call anything)
2. Create the following directories inside the SchedulerDemo directory.
       lib - place your jar file in this directory
       config
       resources
3. Also place plugin.xml directly inside SchedulerDemo directory.
4. Create the zip file.
5. Place the zip file on the OIM server in the environment where you want to deploy it.

How to deploy a scheduled task
Deploying plugin:
6. Next you need to register the plugin(This zip file that you created will be deployed in OIM as a plugin).
7. Set ANT_HOME environment variable.
    export ANT_HOME=/apps/oracle/middleware/modules/org.apache.ant_1.7.1 (env specific)
8. Update PATH environment variable.
     export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH

9. Navigate to $OIM_HOME/server/plugin_utility
10. Edit/Check ant.properties and set the following values:
    wls.home
    oim.home
    mw.home
11. Execute the following command:
    ant -f pluginregistration.xml register
12. In a new environment, sometimes an error is encountered:
     /pluginregistration.xml:72: Class not found: oracle.iam.platform.utils.ant.PasswordInputHandler
In which case, cross check your ant.properties and if the error persists, navigate to the location $WLS_HOME/server/lib
and run: java -jar wljarbuilder.jar
13. Once this is done, navigate back to $OIM_HOME/server/plugin_utility and execute ant -f pluginregistration.xml register
14. You will need to provide the following values to the script
    User name: xelsysadm
    Password: xelsysadm's password (enc specific)
    URL:  t3://OIM_HOST:OIM_PORT (env specific). like t3://rohitdemo:14000
15. Checkpoint: Once the script run successfully, query the plugins table to see that the plugin was deployed.

Registering Metadata:
Now you need to import the metadata file that you created inside the MDS data store. We will use weblogicImportMetadata utility to do the same.

16. Place the metadata file on the server.
17. Navigate to  $OIM_HOME/server/bin
18. Take a backup of weblogic.properties file
19. Edit weblogic.properties file 
20. Set the value of 'metadata_to_loc'
21. Set OIM_ORACLE_HOME same as OIM_HOME
22. Execute command:
 ./weblogicImportMetadata.sh
Provide the following values:
weblogic (NOT xelsysadm)
weblogic's password
t3://OIM_HOST:OIM_POST (NOT weblogic port but OIM's port)

How to create a scheduled job 
1. Create from sysadmin console
2. Search for task name configured in metadata file

Wednesday, December 13, 2017

OIM: Application Instance not visible in catalog

Check if the application exists in the APP_INSTANCE table:
select * from APP_INSTANCE where APP_INSTANCE_NAME like '<put application name here>';

If the application does not exists, you will have to either load or create an application first before it can be requested/viewed by catalog.

If the application instance is present, query the catalog table and check if the application is present in the catalog table:
select entity_name, ENTITY_DISPLAY_NAME, IS_DELETED, IS_REQUESTABLE from catalog where category = 'ApplicationInstance' AND entity_display_name like '<put application name here>';

If you get a result, it will mean that application is present in catalog but will not be requestable. Set 'IS_REQUESTABLE' flag to 1 and your application will be reflected in catalog.

If no result is returned by the query, it means that application is present in the application instance table but not in catalog table. To synch up the data, execute the OOTB scheduled task 'Catalog Synchronization Job' with the following parameters:
  • Process Application Instances : YES
  • Updated Date: Set to blank
  • Mode: Full
Post the successful execution of the job, the application will be reflected in catalog.

Tuesday, December 12, 2017

OIM: Password Updated Task Not Triggered When Updating Password in Process Form

In OIM 11.1.2.2.0 and higher versions, when updating the Password field of process tasks, the Password Updated task is not triggered. All other <Field> Updated tasks are triggered successfully.

Starting with OIM 11g R2 PS2, account passwords need to be updated using the Reset Password operation from the Accounts sub-tab. Password modify operation in the process form will not honor account password changes. This change was done by Unpublished BUG 16518024 - CHANGE ACCOUNT PASSWORD SHOULD ALLOW CUSTOMIZATION

Use the Reset Password operation from the Accounts sub-tab.

BUG:22018915 - FORGOT PASSWORD FAILED TO UPDATE USER'S EBS UM ACCOUNT AFTER AD FIX



https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=314336318295927&parent=EXTERNAL_SEARCH&sourceId=PROBLEM&id=2218280.1&_afrWindowMode=0&_adf.ctrl-state=thbunsygn_4

WSM-02120 : Unable to connect to the policy access service.

There may be multiple reasons for this error. The wsm-pm deployment may be down, check the status of the same from weblogic deployment.

If it is up and running, the "Use JSSE SSL" flag may be enabled on the AdminServer.

  1. Login in to the Weblogic Console
  2. Navigate to Environment > Servers > AdminServer > SSL > Expand Advanced
  3. Uncheck 'Use JSSE SSL' flag.

Monday, December 11, 2017

Exception in thread "main" java.lang.NoClassDefFoundError: oracle/sql/BfileDBAccess

Add "ojdbc6.jar" driver to the classpath of your project.

java.lang.UnsupportedOperationException: Remote JDBC disabled

java.lang.UnsupportedOperationException: Remote JDBC disabled


  1. Edit the setDomainEnv.sh file located at $DOMAIN_HOME/bin i.e $MW_HOME/user project/domains/<DOMAIN_NAME>/bin.
  2. Update WLS_JDBC_REMOTE_ENABLED value from false to true. i.e WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"
  3. Restart the servers.

java.net.ProtocolException: Tunneling result unspecified - is the HTTP server at host: '' and port: '' a WebLogic Server?

java.net.ProtocolException: Tunneling result unspecified - is the HTTP server at host: '<Host Name>' and port: '<Port Number>' a WebLogic Server?


  1. Login into weblogic console.
  2. Go to the Environment > Servers > <Server> Protocols > HTTP and set Enable Tunneling= true,  where <Server> is the server running at the port specified in the error