org.hibernate.AssertionFailure: null identifier

Hibernate JIRA | Rupesh Kumar | 8 years ago
  1. 0

    As per the API of PreInsert/Update/DeleteEventListeners, if it returns "true", the operation should be aborted. However, the behavior I see is and I can confirm from the hibernate source as well is - the operation does get aborted but then it proceeds to call the post events and then it tries to proceed further resulting in some assertion error. So there are two issues here - Post Events get called even though the operation does not happen. - If the pre* callbacks return true, it leads to some exception. Here is the stacktrace for Insert org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:61) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:325) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534) In the hibernate source 3.3.1 -> take a look at org.hibernate.action.EntityIdentityInsertAction.execute():65 It gets the veto result back and inserts only if veto was false. however it then calls postInsert() irrespective of veto value. Since this was triggered by ActionQueue.execute(), the veto information could not be propagated back and hence AbstractSaveEventListener tries to proceed ahead and finally throws up error.

    Hibernate JIRA | 8 years ago | Rupesh Kumar
    org.hibernate.AssertionFailure: null identifier
  2. 0

    As per the API of PreInsert/Update/DeleteEventListeners, if it returns "true", the operation should be aborted. However, the behavior I see is and I can confirm from the hibernate source as well is - the operation does get aborted but then it proceeds to call the post events and then it tries to proceed further resulting in some assertion error. So there are two issues here - Post Events get called even though the operation does not happen. - If the pre* callbacks return true, it leads to some exception. Here is the stacktrace for Insert org.hibernate.AssertionFailure: null identifier at org.hibernate.engine.EntityKey.<init>(EntityKey.java:61) at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:325) at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534) In the hibernate source 3.3.1 -> take a look at org.hibernate.action.EntityIdentityInsertAction.execute():65 It gets the veto result back and inserts only if veto was false. however it then calls postInsert() irrespective of veto value. Since this was triggered by ActionQueue.execute(), the veto information could not be propagated back and hence AbstractSaveEventListener tries to proceed ahead and finally throws up error.

    Hibernate JIRA | 8 years ago | Rupesh Kumar
    org.hibernate.AssertionFailure: null identifier
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

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

    atlassian.net | 1 year ago
    org.hibernate.AssertionFailure: null identifier
  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 3 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:61)
    1 frame
  3. Hibernate
    SessionImpl.fireSaveOrUpdate
    1. org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:325)
    2. org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
    3. org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
    4. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
    5. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
    6. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
    7. org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
    8. org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:534)
    8 frames