/** * Register the p-units of a given bundle. * * @param b the bundle the p-units are in */ public void registerPersistenceUnitsInBundle(Bundle b) { debug("Extender.registerPersistenceUnitsInBundle: ", b); if (!isAssigned(b)) { warning("Register called on bundle " + b.getSymbolicName(), " but bundle was not assigned"); return; } if (areCompatibleBundles(b, mgr.getBundle())) { debug("Extender provider compatible with bundle: ", b); mgr.registerPersistenceUnits(unitsByBundle.get(b)); } else { warning( "Cannot support bundle " + b.getSymbolicName() + " because it is not JPA-compatible with the EclipseLink bundles. " + "This is because there are multiple bundles exporting javax.persistence " + "and the persistence unit bundle has resolved to a different one than " + "the EclipseLink bundles. " + "\nTo fix this, uninstall one of the bundles containing javax.persistence " + "so that both the persistence unit bundle and the provider bundles resolve " + "to the same javax.persistence package."); unassignPersistenceUnitsInBundle(b); // No point in updating or refreshing. // It would likely just re-resolve to the same JPA interface package. } }