• Find us:
    +1 415 655 1723   |   +91-844-844-8901
  • Free Newsletter

     
     

  • Archive

  • Categories


  • OIM 11gR2 OIMClient API : UserManager Service

    Posted by "" in "FMW, OIM" on 2014-09-29

    Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

    Oracle provides Java Application Programming Interfaces (APIs) for communicating with the Oracle Identity Manager programmatically.

    OIMClient acts as an entry point to the Oracle Identity Manager Services.

    UserManager and RoleManager classes are used to manage the lifecycle of users and groups respectively. You can find the detailed information about how to use them here : http://docs.oracle.com/cd/E40329_01/dev.1112/e27150/apis.htm#CIHDFGAJ

    You can also check my post here on how to use UserManager API : http://gskblogs.blogspot.co.uk/2012/12/oim-111200-11gr2-api-usermanager.html

     

    This post is to share an exception that I faced recently when using UserManager API. Following is the stacktrace:

     

    Sep 24, 2014 11:52:13 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh

    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@4095c5ec: display name [org.springframework.context.support.ClassPathXmlApplicationContext@4095c5ec]; startup date [Wed Sep 24 11:52:13 BST 2014]; root of context hierarchy

    Sep 24, 2014 11:52:13 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

    INFO: Loading XML bean definitions from class path resource [META-INF/iam-spring-config.xml]

    Sep 24, 2014 11:52:13 AM oracle.iam.platform.utils.SpringBeanFactory createBeanFactory

    SEVERE: Instantiating Spring Bean Factory Failed.IOException parsing XML document from class path resource [META-INF/iam-spring-config.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/iam-spring-config.xml] cannot be opened because it does not exist

    Exception in thread “main” java.lang.ExceptionInInitializerError

    at oracle.iam.platform.Platform.<clinit>(Platform.java:102)

    at com.mycompany.oim.client.MyOIMClient.main(MyOIMClient.java:38)

    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [META-INF/iam-spring-config.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/iam-spring-config.xml] cannot be opened because it does not exist

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)

    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)

    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:80)

    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)

    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)

    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)

    at oracle.iam.platform.utils.SpringBeanFactory.createBeanFactory(SpringBeanFactory.java:56)

    at oracle.iam.platform.utils.SpringBeanFactory.<clinit>(SpringBeanFactory.java:52)

    … 2 more

    Caused by: java.io.FileNotFoundException: class path resource [META-INF/iam-spring-config.xml] cannot be opened because it does not exist

    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)

    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

    … 16 more

     

    I had used the following code to get the UserManager service:

     

    UserManager userManager = Platform.getService(UserManager.class);

     

    Instead of this, you should use the below code:

     

    UserManager userManager = oimClient.getService(UserManager.class);

     

    This should resolve the problem. I hope it helps you guys.

    Thanks for reading.

    Ganesh Kamble works as Oracle Fusion Middleware Consultant and is an Oracle Certified Specialist in Access Management. Having started his career in product development at Oracle, Ganesh got excellent exposure to the middleware technologies during his work in integration of Tier-1 banking product Oracle Banking Platform with Oracle Fusion Middleware products. He was honored with Outstanding Contribution award by Oracle.
    His key areas of interest are Oracle Identity and Access Management, Oracle Service Oriented Architecture and Java with passion for blogging on various encounters with Oracle products. He publishes blogs regularly on http://k21technologies.com/blog/. He can be reached at ganesh.kamble@k21technologies.com and http://twitter.com/ganeshk_8
    Share on FacebookTweet about this on TwitterShare on Google+Share on LinkedInEmail this to someone

    Leave a Reply

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



  • K21 Technologies is among the most experienced Oracle Gold Partner for Identity Access Management service providers. We work with application development companies and in-house technology division to help achieve significant returns on their IT security investment. Our clientele includes some of the globally renowned corporate, which speaks of our expertise in our field.

    We have the most talented and experienced team that can swiftly deploy security solutions even in complex IT ecosystem. Our clients highly appreciate our timely implementation, interactive training, on-demand support and community resources.
  • CONTACTS

    K21 Technologies
    128 Uxbridge Road, Hatchend,,
    London, HA5 4DS

    US: +1 415 655 1723
    India: +91-844-844-8901

  • Copyright 2019, K21 Technologies. All rights reserved
  • TOP
    TOP