LocalContainerEntityManagerFactoryBean, Hibernate and superflous tables created in wrong database

TL;DR Hibernate's (3.2-3.4) JPA implementation will pick up hbm files on it's own when it should be looking only at persistence.xml, thus: - loading more entities that it should - loading the wrong entities - performing schema updates in the wrong database This one annoyed me plenty and took a great deal of debugging to … Continue reading LocalContainerEntityManagerFactoryBean, Hibernate and superflous tables created in wrong database

java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable

My current project is using JPA, heavily. JPA is a spec/standard/interface and I'm using the Hibernate implementation for it, but I import the entities from a different maven module. The entities module has a dependency on JPA, but not on Hibernate. So when I run my unit tests, I suddenly get a: java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable Openjpa? … Continue reading java.lang.NoClassDefFoundError: org/apache/openjpa/enhance/PersistenceCapable