[jboss-jira] [JBoss JIRA] Reopened: (EJBTHREE-1730) Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a non-jta-data-source for a RESOURCE_LOCAL

Spec Dev (JIRA) jira-events at lists.jboss.org
Tue Feb 17 21:19:44 EST 2009


     [ https://jira.jboss.org/jira/browse/EJBTHREE-1730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Spec Dev reopened EJBTHREE-1730:
--------------------------------



Why the new restriction?

In JBoss 4.2.2 I was able to not define a non-jta datasource.
I delegated the configuration of the datasource to Spring for specific reasons.

The specs say nothing about forcing the definition of a non-jta datasource.
Hence the code is broken and needs fixing.

Here is a snippet of my Spring config:

<!-- %%%%%%%%%%%%%%%%%%%%%%%%%% JPA Entity Manager %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
    <bean id="persistenceUnitManager"
        class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
        <property name="defaultDataSource" ref="dataSource" />
    </bean>
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitManager" ref="persistenceUnitManager" />
    </bean>
    <bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
    
    <!-- %%%%%%%%%%%%%%%%%%%%%%%%%% Transaction Manager %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
    
    <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <property name="jpaDialect" ref="jpaDialect"/>
    </bean>

> Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a non-jta-data-source for a RESOURCE_LOCAL
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: EJBTHREE-1730
>                 URL: https://jira.jboss.org/jira/browse/EJBTHREE-1730
>             Project: EJB 3.0
>          Issue Type: Bug
>          Components: ejb3
>         Environment: JBoss v5.0
> Spring 2.5
>            Reporter: Spec Dev
>            Assignee: Carlo de Wolf
>
> The same application that works fine in JBoss 4.2.2 fails in JBoss v5.0 with the following exception:
> 13:42:16,343 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#MyPU state=Create
> java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a non-jta-data-source for a RESOURCE_LOCAL enabled persistence context named: MyPU
> The persistence unit for the application uses a datasource configured and managed by Spring.
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
> 	<persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL">
>         <provider>org.hibernate.ejb.HibernatePersistence</provider>
>         <properties>
>             <property name="hibernate.format_sql" value="true"/>
>             <property name="hibernate.order_updates" value="true"/>
>             <property name="hibernate.hbm2ddl.auto" value="validate"/>
>             <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
>             <!-- property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/-->
>             <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
>         </properties>
>     </persistence-unit>
> </persistence>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list