引起:javax.persistence.PersistenceException:错误构建回调侦听器;实体已经处理完毕

时间:2014-10-24 14:33:28

标签: java spring hibernate jpa persistence

使用entitymanagerfactory创建bean时出错,原因如下 初始化ehcacheregion工厂时。

Caused by: javax.persistence.PersistenceException: Error build callback listeners; entity was already processed
    at org.hibernate.jpa.event.internal.jpa.CallbackRegistryImpl.addEntityCallbacks(CallbackRegistryImpl.java:131)
    at org.hibernate.jpa.event.internal.jpa.LegacyCallbackProcessor.processCallbacksForEntity(LegacyCallbackProcessor.java:71)
    at org.hibernate.jpa.event.spi.JpaIntegrator.integrate(JpaIntegrator.java:150)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:312)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
    at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
    at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:336)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
    ... 29 more

hibernate版本是4.3.6,hibernate jpa 2.1,hibernate-ehcache-4.3.6, secondarylevel cache是​​真的。

我有一个实体在单个时间内声明了int eh映射文件,并且当它定义了三次且具有不同的descrimnation值时它具有子类。它是升级活动

1 个答案:

答案 0 :(得分:0)

Hibernate 4.3.x存在一个已知问题:https://hibernate.atlassian.net/browse/HHH-8775

也许尝试使用最新的4.2.x版本来查看是否有帮助?