@Gunnar: I believe what is happening is: 1. The OSGI container has JPA 2 jar physically in its system-wide library path, and also exports the JPA 2 OSGI bundle as 1.1. 2. HV imports JPA as 2.0, and so does not get the JPA 2 bundle wired up, but has access to the jar in the system classpath. 3. DefaultTraversableResolver uses reflection to detect the presence of javax.persistence.Persistence and of method getPersistenceUtil. Since the jar is in the system classpath, the class and method is found--even though the bundle is not wired up. The log indeed shows "Found, assuming JPA 2 environment." 4. Since HV is importing the bundle as 2.0, the bundle is not wired up through OSGI, and so when isReachable references javax.persistence.Persistence, it results in NoClassDefFoundError. So ideally, JPA would not be detected using reflection. But even if that were fixed, JPA 2 wouldn't be found because of the incorrect import version |