`
NicholasBugs
  • 浏览: 51785 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

hibernate.AssertionFailure

 
阅读更多
hibernate.AssertionFailure: collection was not processed by flush()
在把Compass2.0整合到应用程序中时遇到这样的错误。
其中Compass用来索引domain A, B.
A和B是一对多关系。
如下
Class A{
...  
}

Class B{
 private A a;
 ...
}
//在A,B的hbm文件中通过many-to-one 和 one-to-many关联。

在没有加入Compass之前,对这两个domain的查找,更新没有任何问题。
在加入Compass之后,对这两个dimain进行索引,然后查询,也没有问题。
对domain A更新也没有问题。
但是当对父A添加一个子B时,就出现了文章开头的异常情形。
下面的链接里也出现了这样的问题,不过他用的是 hibernate search
http://forum.springframework.org/showthread.php?t=49058
再好好研究下什么原因。谁如果遇到类似的情形,麻烦把解决方案留下,

下面贴下完整的stackTrace

    org.hibernate.AssertionFailure: collection was not processed by flush()
    at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:183)
    at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:328)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
    at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:586)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:564)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:537)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:267)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:169)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:169)
    at $Proxy22.saveOrUpdateComment(Unknown Source)
    at com.gln.bloger.action.CommentAction.post(CommentAction.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
    at com.gln.bloger.action.BaseAction.execute(BaseAction.java:72)
    at com.gln.bloger.action.GuestBaseAction.execute(GuestBaseAction.java:71)
    at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
    at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
    at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
    at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    at com.gln.bloger.servlet.BlogActionServlet.process(BlogActionServlet.java:74)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.tuckey.web.filters.urlrewrite.RewrittenUrl.doRewrite(RewrittenUrl.java:176)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Thread.java:595)
    org.hibernate.AssertionFailure: collection was not processed by flush()
    at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:183)
    at org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:328)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:980)
    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:353)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
    at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:586)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:564)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:537)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:267)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:169)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:169)
    at $Proxy22.saveOrUpdateComment(Unknown Source)
    at com.gln.bloger.action.CommentAction.post(CommentAction.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
    at com.gln.bloger.action.BaseAction.execute(BaseAction.java:72)
    at com.gln.bloger.action.GuestBaseAction.execute(GuestBaseAction.java:71)
    at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
    at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
    at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
    at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
    at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
    at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
    at com.gln.bloger.servlet.BlogActionServlet.process(BlogActionServlet.java:74)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:469)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.tuckey.web.filters.urlrewrite.RewrittenUrl.doRewrite(RewrittenUrl.java:176)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Thread.java:595)
分享到:
评论

相关推荐

    hibernate.cfg.xml

    hibernate.cfg.xml hibernate框架的配置文件

    ssh整合,不带hibernate.cfg.xml的方式

    在这个场景中,我们关注的是不通过传统的`hibernate.cfg.xml`文件来配置Hibernate,而是借助Spring框架的`LocalSessionFactoryBean`进行整合。 首先,`hibernate.cfg.xml`是Hibernate传统配置文件,它包含了数据库...

    Hibernate配置文件hibernate.cfg.xml中配置信息详解

    Hibernate配置文件hibernate.cfg.xml中配置信息详解!

    hibernate.cfg.xml 配置 和数据库驱动

    《hibernate.cfg.xml配置与数据库驱动详解》 在Java Web开发中,Hibernate是一个非常流行的持久化框架,它简化了数据库操作,使开发者能够更专注于业务逻辑而不是底层数据存储。而`hibernate.cfg.xml`文件是...

    spring-hibernate.jar

    spring-hibernate.jar

    hibernate.cfg.xml文件详细解释

    ### hibernate.cfg.xml 文件详解 #### 一、概述 `hibernate.cfg.xml` 是 Hibernate 框架的核心配置文件之一,它主要用于配置 Hibernate 的运行环境。通过该文件,开发者可以指定数据库连接信息、日志级别、性能...

    hibernate.hbm2ddl.auto属性详解

    详解hibernate.hbm2ddl.atuo 属性的配置

    hibernate配置文件hibernate.cfg.xml的详细解释

    ### Hibernate配置文件hibernate.cfg.xml的详细解释 #### 一、引言 在Java持久化框架Hibernate中,`hibernate.cfg.xml`是核心配置文件之一,它用于配置Hibernate的运行环境,包括数据库连接信息、性能参数以及其他...

    hibernate.cfg.xml中配置信息详解

    Hibernate.cfg.xml 配置信息详解 Hibernate.cfg.xml 是 Hibernate 框架中的一份核心配置文件,用于配置 Hibernate 的行为和性能。该文件中包含了多个配置属性,用于控制 Hibernate 的各种功能和特性。本文将对 ...

    dao-hibernate.jar

    dao-hibernate.jardao-hibernate.jardao-hibernate.jardao-hibernate.jardao-hibernate.jar

    hibernate.properties.template

    所有数据库连接驱动配置模板 hibernate.connection.driver_class ...hibernate.connection.url jdbc:mysql:///test hibernate.connection.username username hibernate.connection.password password

    hibernate.cfg.xml文件

    《深入理解Hibernate配置文件hibernate.cfg.xml》 在Java应用程序开发中,Hibernate是一个非常流行的对象关系映射(ORM)框架,它简化了数据库操作,将数据库操作与业务逻辑解耦。而`hibernate.cfg.xml`是Hibernate...

    hibernate.properties

    hibernate.properties # # Hibernate, Relational Persistence for Idiomatic Java # # License: GNU Lesser General Public License (LGPL), version 2.1 or later. # See the lgpl.txt file in the root directory...

    hibernate c3p0 数据库连接池参数详解.txt

    在 Hibernate 中,C3P0 的配置主要通过 `hibernate.properties` 或 `hibernate.cfg.xml` 文件中的属性进行设置。这些配置项对于控制连接池的行为至关重要。 #### 3. 关键配置参数详解 ##### 3.1 hibernate....

    hibernate.properties详解

    ### hibernate.properties详解 在Java开发环境中,Hibernate作为一款优秀的对象关系映射(ORM)框架,简化了数据库操作。为了使Hibernate能够正确地与数据库进行交互,必须通过配置文件来指定连接信息及运行时参数...

    Hibernate配置文件hibernate.cfg.xml范本

    这是Hibernate的配置文件,hibernate.cfg.xml的具体写法,共友友们参考~~谢谢~

    08.拓薪教育-hibernate4.3的hibernate.cfg.xml基本配置.part2

    高级Hibernate4开发技术:ORM思想,hibernate介绍,hibernate.cfg.xml配置,hbm.xml映射文件详解,主键生成策略使用,PO对象状态及状态的转换分析、一级缓存,Hibernate数据检索技术,Hibernate高级映射技术,...

    Hibernate的........htm.xml和hibernatecfg.xml配置

    `.hbm.xml`文件用于映射数据库表和Java类之间的关系,而`hibernate.cfg.xml`则是Hibernate的整体配置文件,包含了数据库连接、事务管理等核心设置。 ** Hibernate基础知识 ** Hibernate是一款流行的Java持久化框架...

Global site tag (gtag.js) - Google Analytics