Hi all, I am getting a miss behave from weblogic 12c, I configured a datasource in the server and created a web application where I have declared
- entities
- persistence.xml file: datasource (JTA), hibernate configuration with weblogic.
- beans.xml where I declared my spring beans and especially the <jee:jndi-lookup id="entityManager" jndi-name="jdbc/appsDataSource" /> to retrieve entity Manager from the container.
- my DAO in annotated with @Repository and the EntityManager em in the DAO is annotated with @PersistenceContext(unitName="appsPU"), Also added the <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> in beans.xml
the beans.xml looks then like:
<context:annotation-config />
<tx:annotation-driven />
<tx:jta-transaction-manager />
<jee:jndi-lookup id="appsPU" jndi-name="jdbc/appsDataSource" />
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
DAO
@Repository("appsgenericDao")
public class AppsGenericDaoImpl implements AppsGenericDao {
@PersistenceContext(type = PersistenceContextType.EXTENDED, unitName="appsPU")
private EntityManager em;
my persistence.xml looks is: (using JPA 2.0)
<persistence-unit name="adriaPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/appsDataSource</jta-data-source>
<shared-cache-mode>NONE</shared-cache-mode>
<validation-mode>AUTO</validation-mode>
<properties>
<property name="hibernate.query.jpaql_strict_compliance" value="false" />
<property name="hibernate.jdbc.use_streams_for_binary" value="false" />
<property name="hibernate.archive.autodetection" value="class, hbm" />
<!-- SQL stdout logging -->
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.use_sql_comments" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.cache.use_query_cache" value="false" />
<property name="hibernate.cache.use_second_level_cache" value="false" />
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider" />
<property name="hibernate.cglib.use_reflection_optimizer" value="false" />
<property name="org.hibernate.cacheable" value="false" />
<property name="hibernate.generate_statistics" value="true" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WeblogicJtaPlatform" />
<property name="cache.use_second_level_cache" value="true" />
</properties>
</persistence-unit>
when I run the application I am getting this error:
<13 avr. 2014 22 h 38 WET> <Error> <Deployer> <BEA-149202> <Encountered an exception
while attempting to commit the 7 task for the application "_auto_generated_ear_".>
<13 avr. 2014 22 h 38 WET> <Warning> <Deployer> <BEA-149004> <Failures were detected
while initiating start task for application "_auto_generated_ear_".>
<13 avr. 2014 22 h 38 WET> <Warning> <Deployer> <BEA-149078> <Stack trace for message
149004
weblogic.application.ModuleException:
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'appsPU'must be of type [javax.persistence.EntityManagerFactory], but was actually of type [weblogic.jdbc.common.internal.RmiDataSource]:org.springframework.beans.factory.BeanNotOfRequiredTypeException:Bean named 'appsPU' must be of type [javax.persistence.EntityManagerFactory], but was actually of type [weblogic.jdbc.common.internal.RmiDataSource]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:359)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
I posted this several times but no answer.
Is there something I am missing or miss-configuration?
Thanks for help, any response would be helpful.
Best Regards.