weblogic 12c jndi的奇怪行为

时间:2014-04-07 08:03:57

标签: oracle hibernate jdbc weblogic jndi

在部署带有实体的Web应用程序时,我遇到了与weblogic 12c的奇怪错误。 我使用hibernate 3作为JPA提供程序。 我得到的错误是

Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named      
'ssv6PU' must be of type [javax.persistence.EntityManagerFactory], but was actually of  
type [weblogic.jdbc.common.internal.RmiDataSource]

我的bean被声明为

<tx:annotation-driven />
<tx:jta-transaction-manager />
<jee:jndi-lookup id="ssv6PU" jndi-name="jdbc/ssv6DataSource" />
<bean
    class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

和持久性单位:

<persistence-unit name="ssv6PU" transaction-type="JTA">

    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/ssv6DataSource</jta-data-source>

    <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.connection.autocommit" value="false" />
        <property name="hibernate.hbm2ddl.auto" value="validate" />
        <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.factory_class"
                  value="org.hibernate.transaction.JTATransactionFactory"/>
        <property name="cache.use_second_level_cache" value="true"/>

    </properties>
</persistence-unit>

奇怪的是这在MySQL 5中运行良好, 我缺少一些配置吗?我认为这是司机的问题。 weblogic服务器中的数据源使用Oracle Thin驱动程序来实现11.2.0.3数据库版本的应用程序连续性。

0 个答案:

没有答案