Hello,
I´m newbie working with OIM and@ I´m trying to use Spring Framework inside a custom plugin and customs jars, but I´m having some problems.
1) I dont know how to load properly the spring context file. In this file (spring-context.xml) is located the hibernate configuration and the tipical cofiguration tags.
<context:annotation-config />
<tx:annotation-driven />
<context:component-scan base-package="com.personal.test"/>
I´ve tested the configuration with JUnit and works well. Someone knows where I should put this file to be loaded automaticly for OIM?
2) I put the spring-context.xml in the folder $OIM_HOME0/apps/oim.ear/META-INF/ and I´m loading the configuration with this code
ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:**/spring-context.xml");
in a Configuration class located in a jar. In this way OIM load the Spring context, but It is giving an ERROR:
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@28975662: display name [org.springframework.context.support.ClassPathXmlApplicationContext@28975662]; startup date [Fri Aug 12 02:31:23 PDT 2016]; root of context hierarchy
INFO: Loading XML bean definitions from file [/app/Middleware/Oracle_IDM1/server/apps/oim.ear/META-INF/spring-context.xml]
INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@28975662]: org.springframework.beans.factory.support.DefaultListableBeanFactory@41d0dd1
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@41d0dd1: defining beans [org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,dataSource,sessionFactory,transactionManager]; root of factory hierarchy
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@41d0dd1: defining beans [org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,dataSource,sessionFactory,transactionManager]; root of factory hierarchy
SEVERE: Error loading CLASSPATH context
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/SessionFactory
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
It seams that OIM dont recognize the hibernate jars in Classpath, so I've tried this points from another discussion and have the same result: @"Abhishek Singh "
- You can try uploading it into the ThirdParty, and also, from the weblogic console, go to your server startup parameters and add the path of the jar file into the startup class
- You can try your thirdparty .jar in $DOMAIN_HOME/lib folder and restart
- You can place Jar into OIM lib directory $OIM_HOME/apps/oim.ear/APP-INF/lib/ and restart
- You can modify the script that launch weblogic (namelly startWeblogic.sh) and add in the classpath a folder called "MyFolder" where your third party jars are kept.
Any help will be appreciated.
Thansk!!