[
http://jira.jboss.com/jira/browse/EJBTHREE-1193?page=all ]
Ming Fai Ma updated EJBTHREE-1193:
----------------------------------
Description:
The EJB3 Persistence Unit parsing deployer read and try to start and install a persistence
unit with JBoss PersistenceUnitDeployment even though a "provider" attribute is
specified to use another JPA implementation.
14:53:17,368 INFO [PersistenceUnitParsingDeployer] Found persistence units
[org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@4de8d8{name=MyApp}]
14:53:18,431 INFO [PersistenceUnitParsingDeployer] Found persistence units
[org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@778590{name=MyAppWeb},
org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@e1ccdf{name=MyApp}]
14:53:39,540 INFO [PersistenceUnitDeployment] Starting persistence unit
persistence.units:ear=MyApp.ear,unitName=MyAppWeb
...
org.jboss.ejb3.entity.PersistenceUnitDeployment.start()
Persistence.xml
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<persistence-unit name="MyApp"
transaction-type="RESOURCE_LOCAL">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<jta-data-source>java:/jdbc/MyDataSource</jta-data-source>
<jar-file>MyJar.jar</jar-file>
</persistence-unit>
</persistence>
was:
The EJB3 Persistence Unit parsing deployer read and try to start and install a persistence
unit with JBoss PersistenceUnitDeployment even though a "provider" attribute is
specified to use another JPA implementation.
14:53:17,368 INFO [PersistenceUnitParsingDeployer] Found persistence units
[org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@4de8d8{name=MyApp}]
14:53:18,431 INFO [PersistenceUnitParsingDeployer] Found persistence units
[org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@778590{name=MyAppWeb},
org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@e1ccdf{name=MyApp}]
14:53:39,540 INFO [PersistenceUnitDeployment] Starting persistence unit
persistence.units:ear=CyberGameCityApp.ear,unitName=CyberGameCityAppWeb
...
org.jboss.ejb3.entity.PersistenceUnitDeployment.start()
Persistence.xml
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<persistence-unit name="MyApp"
transaction-type="RESOURCE_LOCAL">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<jta-data-source>java:/jdbc/MyDataSource</jta-data-source>
<jar-file>MyJar.jar</jar-file>
</persistence-unit>
</persistence>
ok. so you mean the PersistenceUnitDeployment.start() shall be called no matter which JPA
provider it is defined to use.
my actual problem is I got a RuntimeException saying "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", if I change the the transaction-type to JPA it just
hangs. But I expect if I have defined the provider as OpenJPA, the deployment shall not
care about the data source at all. It should just skip processing the remain part of the
persistence.xml configuration. In JBoss 4.2.2 there is no such checking so my application
works without problem.
I've just read the PersistenceUnitDeployment code and it seems it is just to check
against the spec and there is nothing wrong.
(
http://anonsvn.jboss.org/repos/jbossas/trunk/ejb3/src/main/org/jboss/ejb3...)
Perhaps my data source has problem. I'll double check it myself. Sorry for the wrong
issue reporting.
Persistence Unit Parsing Deploy ignores the Provider attribute in
persistence.xml
---------------------------------------------------------------------------------
Key: EJBTHREE-1193
URL:
http://jira.jboss.com/jira/browse/EJBTHREE-1193
Project: EJB 3.0
Issue Type: Bug
Affects Versions: AS 5.0.0.Beta4
Reporter: Ming Fai Ma
Assigned To: Emmanuel Bernard
The EJB3 Persistence Unit parsing deployer read and try to start and install a
persistence unit with JBoss PersistenceUnitDeployment even though a "provider"
attribute is specified to use another JPA implementation.
14:53:17,368 INFO [PersistenceUnitParsingDeployer] Found persistence units
[org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@4de8d8{name=MyApp}]
14:53:18,431 INFO [PersistenceUnitParsingDeployer] Found persistence units
[org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@778590{name=MyAppWeb},
org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@e1ccdf{name=MyApp}]
14:53:39,540 INFO [PersistenceUnitDeployment] Starting persistence unit
persistence.units:ear=MyApp.ear,unitName=MyAppWeb
...
org.jboss.ejb3.entity.PersistenceUnitDeployment.start()
Persistence.xml
----------------------
<?xml version="1.0" encoding="UTF-8"?>
<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0">
<persistence-unit name="MyApp"
transaction-type="RESOURCE_LOCAL">
<provider>
org.apache.openjpa.persistence.PersistenceProviderImpl
</provider>
<jta-data-source>java:/jdbc/MyDataSource</jta-data-source>
<jar-file>MyJar.jar</jar-file>
</persistence-unit>
</persistence>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira