2 Replies Latest reply on Jul 28, 2007 12:32 AM by wiberto

    Cannot create EntityManager from Springframework

    fatdragon

      Not sure it is spring or jboss issue but i keep getting the following exception when starting up my standalone web module. I tried both the 4.20 RC2 and 4.05GA with ejb3 patch, same result.

      The plan was using spring bean inject the entitymanger at some part of my code using
      org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
      bean

      I am confused by the error message, since when org.hibernate.ejb.HibernatePersistence not implements the javax.persistence.spi.PersistenceProvider
      Is that becase i have some old jar file floating around?

      Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Class org.hibernate.ejb.HibernatePersistence does not implement the requested interface javax.persistence.spi.PersistenceProvider
      Caused by:
      java.lang.IncompatibleClassChangeError: Class org.hibernate.ejb.HibernatePersistence does not implement the requested interface javax.persistence.spi.PersistenceProvider
      at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)
      at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1175)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1145)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)