org.hibernate.AssertionFailure

问题描述

org.hibernate.AssertionFailure:nullidincom.lhd.ssms.model.Courseentry(don'tflushtheSessionafteranexceptionoccurs)org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:78)org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:187)org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143)org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:732)org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)$Proxy16.course_add(UnknownSource)com.lhd.ssms.action.CourseAction.add(CourseAction.java:64)sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

解决方案

解决方案二:
求求各位大侠,帮我看看啊。太郁闷了。
解决方案三:
哎,原来是hibernate的一个配饰类型整错了。Integer行的整成String型的了。
解决方案四:
引用2楼lanhuadong的回复:

哎,原来是hibernate的一个配饰类型整错了。Integer行的整成String型的了。

楼主真厉害,自己解决了。

时间: 2024-10-08 19:03:42

org.hibernate.AssertionFailure的相关文章

ssertion ailure-org.hibernate.AssertionFailure问题的解决

问题描述 org.hibernate.AssertionFailure问题的解决 当在ssh项目中使用compass后就出现出现这样的问题了,不知道如何解决,望好心人给提示一下解决方法!

SSH系统异常hibernate.AssertionFailure: collection[] was not processed by flush()

问题描述 话说问题之前,先把异常堆栈贴出来:19:28:17,671ERRORAssertionFailure:22-anassertionfailureoccured(thismayindicateabuginHibernate,butismorelikelyduetounsafeuseofthesession)org.hibernate.AssertionFailure:collection[com.iwork.basic.model.IOrganization.childOrg]wasno

建表-各位大神,小弟关于hibernate有一些疑问

问题描述 各位大神,小弟关于hibernate有一些疑问 我是实体类继承建立数据库表的问题 我先建立了一个 @MappedSuperclass public abstract class AbEntity { @Id @GeneratedValue private Integer id; } 然后建立了User类 继承它 @Entity @Table(name="user") @Inheritance(strategy=InheritanceType.JOINED) public cl

mysql-Mysql做了主从配置之后,启动项目就出现异常了。提示Hibernate什么的,不知道这么回事

问题描述 Mysql做了主从配置之后,启动项目就出现异常了.提示Hibernate什么的,不知道这么回事 2016-02-25 13:38:51353 [localhost-startStop-1] [test.ResourceBuilder] [INFO] - Hibernate operation: could not insert: [accessResources.BtnAndMenu]; uncategorized SQLException for SQL [insert into b

hibernate 执行此条delete Lc_Admin where id in(?)删除第一个

问题描述 hibernate 执行此条delete Lc_Admin where id in(?)删除第一个 ?public boolean runByHql(String hql, Object...params) { try { Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery(hql); if(params != null && params.le

hibernate中用annotation注解怎么样配置TIMESTAMP类型的数据呢

问题描述 请问hibernate中用annotation注解怎么样配置TIMESTAMP类型的数据并且能自动插入和更新呢?就是相当于mysql中timeTIMESTAMPDEFAULTCURRENT_TIMESTAMPONUPDATECURRENT_TIMESTAMP;这样的数据列,在hibernate中怎么样用annotation注解来配置呢(不要xml的配置方式).各位大虾帮帮忙啊,跪求中-- 解决方案 解决方案二:没用过注解吖.看下这个资料吧解决方案三:@Column(name="D_UP

混合Eclipse、WTP、Struts和Hibernate

使用Eclipse Web Tools Project.Tomcat应用服务器和MySQL数据库服务器,创建了一个Web应用程序.尽管该应用程序(DBTest)可能会很不错,但是也会存在一些局限性: 在servlet代码中,Java Server Pages (JSP) 名称是硬编码的 SQL也被硬编码到命令类中. 幸运的是,这些问题可以通过两种有趣的解决方案得以解决.第一个问题可通过使用开源Struts框架解决,该框架通过将模型动作映射到一个简单配置文件中的视图组件(比如JSP),从而分离应用

系统学习hibernate之三 transient、persistent、detached状态

transient.persistent.detached状态关系图如下: 1.transient状态的特征: * 在数据库中没有与之匹配的数据 * 没有纳入session的管理 2.persistent状态的特征: * persistent状态的对象在数据库中有与之匹配的数据 * 纳入了session的管理 * 在清理缓存(脏数据检查)的时候,会和数据库同步 3.detached状态的特征: * 在数据库中有与之匹配的数据 * 没有纳入session的管理 PS:了解这几种状态对深入使用hib

Hibernate流行架构浅析

本文向大家介绍Hibernate架构,可能好多人还不了解Hibernate架构,没有关系,看完本文你肯定有不少收获,希望本文能教会你更多东西. 用java来建立一个很有价值的web 应用不是一个简单的任务.在架构这个应用时要考虑很多的因素和问题.从更高的层次来看,开发人员面临着关于如何构建用户接口,何处驻留业务逻辑,以及如何实现数据持久性这些问题.这3层都有各自的问题需要回答.而每一层又需要实现那些技术?应用如何设计来进行松散耦合并能进行灵活变更?应用架构是否允许某一层变更而不影响到其它的层次?