I'm trying to setup Spring + JPA + ObjectDb in my test environment and having trouble with the following:
<bean id="EnvDMSEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="envService"/> <property name="persistenceXmlLocation" value="com/company/persistence.xml"/> </bean>
Here is the stack trace I get:
Caused by: java.lang.AbstractMethodError: org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode; at com.objectdb.jpa.EMF.init(EMF.java:86) at com.objectdb.jpa.Provider.newEMF(Provider.java:134) at com.objectdb.jpa.Provider.createContainerEntityManagerFactory(Provider.java:118) at com.objectdb.jpa.Provider.createContainerEntityManagerFactory(Provider.java:32) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:224) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335) ... 45 more
This is with Spring 2.5.6. I'm doing it this way instead of using LocalEntityManagerFactory due to the constraints of my test setup and difficulty in placing persistence.xml in one of the conventional places. It is much easier to specify the location as a property on the bean. Why do I get this exception?