Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [net/ibs/config/database.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getSharedCacheMode()Ljavax/persistence/SharedCacheMode;
Juergen Hoeller commented
This looks like you have a JPA 1.0 API jar on the classpath too, getting picked up before your explicitly declared JPA 2.0 API jar. That JPA 1.0 jar probably comes in transitively through your persistence provider, e.g. an old Hibernate version... Note that you have to use Hibernate 3.6 or higher as of Spring 4.0.