org.hibernate.AssertionFailure: null identifier

Hibernate JIRA | Alessandro Rizzi | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [HHH-779] Assertion failure occured with Hibernate 3 saving objects - Hibernate JIRA

    atlassian.net | 2 years ago
    org.hibernate.AssertionFailure: null identifier
  2. 0

    I have this exception: SEVERE: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:33) at org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:51) at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:702) at testHib3.starter.go(starter.java:69) at testHib3.starter.main(starter.java:22) org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:33) at org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:51) at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:702) at testHib3.starter.go(starter.java:69) at testHib3.starter.main(starter.java:22) with this code: Session hibSession = sf.openSession(); tstDACmain m = (tstDACmain)hibSession.load( tstDACmain.class, new Long(1) ); m.setId( null ); hibSession.evict( m); hibSession.saveOrUpdate( m ); hibSession.flush(); and this mapping document: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 1.1//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="testHib3.tstDACmain" table="tst_main"> <id column="id" name="id" type="long"> <generator class="native"></generator> </id> <property column="des" length="50" name="des" not-null="false" type="string"/> </class> </hibernate-mapping> Notice that if you change the code like this: From: tstDACmain m = (tstDACmain)hibSession.load( tstDACmain.class, new Long(1) ); To: tstDACmain m = new tstDACmain(); hibSession.load( m, new Long(1) ); then it works perfectly. No error occurs, and the object is saved in the database. I did not have this error on Hibernate 2.1.8. Regards Alessandro Rizzi

    Hibernate JIRA | 1 decade ago | Alessandro Rizzi
    org.hibernate.AssertionFailure: null identifier
  3. 0

    I have this exception: SEVERE: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:33) at org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:51) at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:702) at testHib3.starter.go(starter.java:69) at testHib3.starter.main(starter.java:22) org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:33) at org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:51) at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:702) at testHib3.starter.go(starter.java:69) at testHib3.starter.main(starter.java:22) with this code: Session hibSession = sf.openSession(); tstDACmain m = (tstDACmain)hibSession.load( tstDACmain.class, new Long(1) ); m.setId( null ); hibSession.evict( m); hibSession.saveOrUpdate( m ); hibSession.flush(); and this mapping document: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 1.1//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="testHib3.tstDACmain" table="tst_main"> <id column="id" name="id" type="long"> <generator class="native"></generator> </id> <property column="des" length="50" name="des" not-null="false" type="string"/> </class> </hibernate-mapping> Notice that if you change the code like this: From: tstDACmain m = (tstDACmain)hibSession.load( tstDACmain.class, new Long(1) ); To: tstDACmain m = new tstDACmain(); hibSession.load( m, new Long(1) ); then it works perfectly. No error occurs, and the object is saved in the database. I did not have this error on Hibernate 2.1.8. Regards Alessandro Rizzi

    Hibernate JIRA | 1 decade ago | Alessandro Rizzi
    org.hibernate.AssertionFailure: null identifier
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Steps: 1. Click on Participants -> Enroll Volunteer 2. The following exception is generated: * Note: these steps were performed with a newly created db. 2010-04-22 13:23:13,355 - ERROR - hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session) org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:39) at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:74) at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:39) at org.hibernate.impl.SessionImpl.fireRefresh(SessionImpl.java:902) at org.hibernate.impl.SessionImpl.refresh(SessionImpl.java:886) at org.obiba.core.service.impl.hibernate.PersistenceManagerHibernateImpl.refresh(PersistenceManagerHibernateImpl.java:102) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy37.refresh(Unknown Source) 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:597) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) at org.apache.wicket.proxy.$Proxy65.refresh(Unknown Source) at org.obiba.wicket.markup.html.table.DetachableEntityModel.<init>(DetachableEntityModel.java:30) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupFragment.addParticipantAttribute(EditParticipantPanel.java:491) at org.obiba.onyx.webapp.participant.panel.ParticipantAttributeGroupFragment.<init>(ParticipantAttributeGroupFragment.java:28) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupFragment.<init>(EditParticipantPanel.java:469) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupsFragment.addAttributeGroupFragment(EditParticipantPanel.java:459) at org.obiba.onyx.webapp.participant.panel.ParticipantAttributeGroupsFragment.<init>(ParticipantAttributeGroupsFragment.java:48) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupsFragment.<init>(EditParticipantPanel.java:454) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel.createEditParticipantPanel(EditParticipantPanel.java:285) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel.<init>(EditParticipantPanel.java:128) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel.<init>(EditParticipantPanel.java:144) at org.obiba.onyx.webapp.participant.panel.EditParticipantFormPanel.<init>(EditParticipantFormPanel.java:28) at org.obiba.onyx.webapp.participant.page.ParticipantReceptionPage.<init>(ParticipantReceptionPage.java:40) at org.obiba.onyx.webapp.participant.page.ParticipantSearchPage$ActionFragment$1.onClick(ParticipantSearchPage.java:517) at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) 2010-04-22 13:23:13,358 - ERROR - apache.wicket.RequestCycle - null identifier org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:39) at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:74) at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:39) at org.hibernate.impl.SessionImpl.fireRefresh(SessionImpl.java:902) at org.hibernate.impl.SessionImpl.refresh(SessionImpl.java:886) at org.obiba.core.service.impl.hibernate.PersistenceManagerHibernateImpl.refresh(PersistenceManagerHibernateImpl.java:102) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:108) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy37.refresh(Unknown Source) 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:597) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:416) at org.apache.wicket.proxy.$Proxy65.refresh(Unknown Source) at org.obiba.wicket.markup.html.table.DetachableEntityModel.<init>(DetachableEntityModel.java:30) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupFragment.addParticipantAttribute(EditParticipantPanel.java:491) at org.obiba.onyx.webapp.participant.panel.ParticipantAttributeGroupFragment.<init>(ParticipantAttributeGroupFragment.java:28) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupFragment.<init>(EditParticipantPanel.java:469) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupsFragment.addAttributeGroupFragment(EditParticipantPanel.java:459) at org.obiba.onyx.webapp.participant.panel.ParticipantAttributeGroupsFragment.<init>(ParticipantAttributeGroupsFragment.java:48) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel$EditParticipantPanelAttributeGroupsFragment.<init>(EditParticipantPanel.java:454) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel.createEditParticipantPanel(EditParticipantPanel.java:285) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel.<init>(EditParticipantPanel.java:128) at org.obiba.onyx.webapp.participant.panel.EditParticipantPanel.<init>(EditParticipantPanel.java:144) at org.obiba.onyx.webapp.participant.panel.EditParticipantFormPanel.<init>(EditParticipantFormPanel.java:28) at org.obiba.onyx.webapp.participant.page.ParticipantReceptionPage.<init>(ParticipantReceptionPage.java:40) at org.obiba.onyx.webapp.participant.page.ParticipantSearchPage$ActionFragment$1.onClick(ParticipantSearchPage.java:517) at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68) at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177) at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

    JIRA | 7 years ago | Tony DeBat
    org.hibernate.AssertionFailure: null identifier

  1. mortalman7 1 times, last 6 months ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.hibernate.AssertionFailure

    null identifier

    at org.hibernate.engine.EntityKey.<init>()
  2. Hibernate
    EntityKey.<init>
    1. org.hibernate.engine.EntityKey.<init>(EntityKey.java:33)
    1 frame
  3. Hibernate
    SessionImpl.evict
    1. org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:51)
    2. org.hibernate.impl.SessionImpl.evict(SessionImpl.java:702)
    2 frames
  4. testHib3
    starter.main
    1. testHib3.starter.go(starter.java:69)
    2. testHib3.starter.main(starter.java:22)
    2 frames