2 Replies Latest reply on Feb 27, 2009 4:01 AM by ryankimber

    Specification violation on startup using JBoss 5.0.1 GA

    ryankimber
      I'm trying to deploy my application to JBoss 5.0.1, but I receive the following message early during startup:

      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: ....

      My application is packaged as an .ear file, with a .war, a utility .jar file and a .jar file that contains both my entity and session beans.

      My persistence.xml is pretty straightforward:

      <?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="OSOSPersistence" transaction-type="RESOURCE_LOCAL">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <jta-data-source>java:/FoundryDatasource</jta-data-source>
                 <properties>
               <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
               <property name="hibernate.hbm2ddl.auto" value="update"/>
               <property name="hibernate.show_sql" value="true"/>
               <property name="hibernate.format_sql" value="true"/>
               <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/foundry"/>
               <property name="jboss.entity.manager.factory.jndi.name" value="java:/FoundryDataSource"/>
                 </properties>
           </persistence-unit>
      </persistence>

      Finally, my components.xml (from the .war file) contains the following two relevant lines:

           <core:init jndi-pattern="FoundryEAR/#{ejbName}/local" />
           <persistence:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:/FoundryDataSource"/>

      Has anyone encountered this issue? Why is it asking for a non-jta datasource?

      Thanks for any assistance you can offer.