`

org.hibernate.AssertionFailure: null id

    博客分类:
  • J2EE
阅读更多
org.hibernate.AssertionFailure: null id in cn.allobject.db.AReview entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:48)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:954)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1526)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at cn.allobject.daoimp.BasicDaoImp.<init>(BasicDaoImp.java:32)
at cn.allobject.factory.DAOFactory.basicFactory(DAOFactory.java:42)
at cn.allobject.struts.action.ShowMenuAction.execute(ShowMenuAction.java:72)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at cn.java1995.filter.GZipFilter.doFilter(GZipFilter.java:38)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at cn.allobject.servlet.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Unknown Source)
分享到:
评论
2 楼 t150ckh 2011-09-28  
  我只遇到是数据表里的ID没有设为自动增长而报的这个错
1 楼 east_java 2008-07-28  
当出现这种情况的时候,删除数据表中的所有数据是好像不行的.得先删除所有数据,再根据对应关系加上一条记录,就OK.

很奇怪.

相关推荐

    hibernate-jpa-2.1-api-1.0.2.Final-API文档-中英对照版.zip

    Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开...

    解决SpringDataJPA报错:org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null w

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...

    HIbernate4.3.6整合c3p0所需jar

    org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] at org.hibernate.service.internal....

    hibernate-validator 5.3.5.Final jar

    hibernate-validator 5.3.5.Final jar包 ;desc:if you want validator your project

    org.hibernate.HibernateException: No Hibernate Session bound to thread

    Hibernate Session 绑定线程解决方案 在 Java web 开发中, Hibernate 是一个非常流行的 ORM(Object-Relational Mapping)框架,用于将 Java 对象映射到关系数据库中。然而,在使用 Hibernate 进行数据库操作时,...

    hibernate-jpa-2.1-api-1.0.2.Final-API文档-中文版.zip

    Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index...

    weblogic12 下 org.hibernate.hql.ast.HqlToken

    ### WebLogic 12下org.hibernate.hql.ast.HqlToken冲突解决方案 在使用WebLogic 12部署应用程序时,可能会遇到与`org.hibernate.hql.ast.HqlToken`相关的异常问题。这种异常通常与Hibernate版本之间的不兼容性有关...

    org.springframework.orm.hibernate3.LocalSessionFactoryBean

    hibernateProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect"); hibernateProperties.setProperty("hibernate.show_sql", "true"); sessionFactory.setHibernateProperties...

    hibernate-validator-6.0.18.Final-sources.jar

    java运行依赖jar包

    org.hibernate.ejb-library-3.4.0.GA-A

    标题 "org.hibernate.ejb-library-3.4.0.GA-A" 指示这是一个与Hibernate相关的库,特别针对EJB(Enterprise JavaBeans)版本3.4.0,并且是为OSGi环境优化的。描述中提到它适用于在Virgo Jetty服务器上进行Web开发,...

    Hibernate不同数据库的连接及SQL方言

    Hibernate提供了多种SQL方言,例如org.hibernate.dialect.OracleDialect、org.hibernate.dialect.MySQLDialect、org.hibernate.dialect.SQLServerDialect等。我们可以在配置文件中使用元素来设置SQL方言,例如: ...

    hibernate annotations

    1. **配置**:首先,需要在项目中引入Hibernate库,并创建一个配置文件(通常是hibernate.cfg.xml),配置数据库连接信息。 2. **实体定义**:使用注解定义实体类及其属性,指定与数据库表的对应关系。 3. **...

    org.hibernate.ejb-library-3.4.0.GA

    标题中的"org.hibernate.ejb-library-3.4.0.GA"是Hibernate Entity Beans的一个特定版本,它是Hibernate框架的一部分,专门用于处理Java Enterprise Edition (EE)环境中的持久化。Hibernate是著名的对象关系映射...

    com.microsoft.sqlserver.jdbc.SQLServerException: 只进结果集不支持请求的操作 解决方案

    query.setHint("org.hibernate.fetchSize", 20); // 设置查询结果集大小 query.setFetchSize(20); List&lt;Game&gt; games = query.list(); tx.commit(); } catch (HibernateException e) { if (tx != null) { tx....

    hibernate(api 介绍).pdf

    提供了各种实现类,例如 org.hibernate.type.PrimitiveType Class、org.hibernate.type.DateType Class 和 org.hibernate.type.BinaryType Class 等。 可扩展接口 1. org.hibernate.dialect.Dialect abstract_...

    hibernate源码包

    2. **org.hibernate.cfg**: 配置相关的类,如Configuration,用于加载Hibernate配置文件,建立SessionFactory。Environment类中定义了一些常量,比如连接数据库所需的属性。 3. **org.hibernate.cache**: 缓存管理...

    hibernate-release-5.2.13.Final 官网

    官网hibernate:问题说明: 1、安装整合通过; 2、整合时注意javassist-3.22.0-GA.jar与struts2.4的 javassist-3.20.0-GA.jar重复; 3、整合所需基础包以及整合需要的外部包,自己放到一个新建文件夹中,方便大家...

    HIbernate4.3.6-c3p0所需jar.rar

    Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.connection.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.... ...

    hibernate-validator-6.0.14.Final.jar

    hibernate-validator-6.0.14.Final.jar

    commons-beanutils-1.7.0

    at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:251) at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:236) at org.hibernate.cfg.HbmBinder.bindRoot...

Global site tag (gtag.js) - Google Analytics