We noticed after switchting from cxf 3.1.7 to 3.2.x that our application is not starting anymore.
After some analysis we found out that the cxf module cxf-rt-rs-security-oauth2 contains a class org.apache.cxf.rs.security.oauth2.grants.code.JPACMTCodeDataProvider which injects an EntityManager using @PersistenceContext without defining a unitName. On our JBoss 6.4 EAP (JBoss 7.x) we get the following error message:
With only one persistence unit definition it's working, but we need multiple PU's.
One solution I have in mind is to define a unitName for the PersistenceContext on the org.apache.cxf.rs.security.oauth2.grants.code.JPACMTCodeDataProvider ("CXF_PU") , so that a PU has to be define explicitly in the persistence.xml, I mean it's not nice but for us it would be ok.
Or perhaps there are other macanisms to avoid the persistence context injection if this class is not used?
It currently prevents us from switchting to the newest cxf version.
I attached a sample maven project to reproduce this issue on a JBoss 7.x .