As documented in JIRA tickets for both Spring Data JPA and JBoss - any app which includes the spring-data-jpa library will not deploy to JBoss 7.1 or later
The Problem:
1. JBoss validates all @PersistenceContext annotations when deploying an application
2. If there are multiple persistence units in an application - it also checks to ensure that all @PersistenceContext annotations provide a unit name - as otherwise the lookup is ambiguous.
3. The class 'JpaRepositoryFactoryBean' in spring-data-jpa fails this validation as it has a @PersistenceContext reference without a unit name.
JBoss has gone through explicit efforts to add these validations and I doubt they will turn back on their deployment check.
Currently we are in a deadlock and no app using spring-data-jpa can run on JBoss 7.1 or later.
TODO:
1. Find a way around this to prevent the validation from failing and yet have the factory continue to work in the expected fashion.
2. Declare JBoss as unsupported/will not work application server for spring-data-jpa
3. Get JBoss to provide some kind of alternative to exclude certain classes from their validation checks.
Affects JBoss AS 7.1+ / JBoss EAP 6.x+
DATAJPA-213 With more than one persistence units, deploy to JBoss AS 7.1.1 error with java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 2 persistence unit definitions
AS7-2275 Deployment error should result when ambiguous injection is specified
The Problem:
1. JBoss validates all @PersistenceContext annotations when deploying an application
2. If there are multiple persistence units in an application - it also checks to ensure that all @PersistenceContext annotations provide a unit name - as otherwise the lookup is ambiguous.
3. The class 'JpaRepositoryFactoryBean' in spring-data-jpa fails this validation as it has a @PersistenceContext reference without a unit name.
JBoss has gone through explicit efforts to add these validations and I doubt they will turn back on their deployment check.
Currently we are in a deadlock and no app using spring-data-jpa can run on JBoss 7.1 or later.
TODO:
1. Find a way around this to prevent the validation from failing and yet have the factory continue to work in the expected fashion.
2. Declare JBoss as unsupported/will not work application server for spring-data-jpa
3. Get JBoss to provide some kind of alternative to exclude certain classes from their validation checks.
Affects JBoss AS 7.1+ / JBoss EAP 6.x+
DATAJPA-213 With more than one persistence units, deploy to JBoss AS 7.1.1 error with java.lang.IllegalArgumentException: JBAS011470: Persistence unitName was not specified and there are 2 persistence unit definitions
AS7-2275 Deployment error should result when ambiguous injection is specified