net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem

Atlassian JIRA | Dave Loeng [Atlassian] | 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

    Mark H tried to import data into Extranet and it failed. There were a couple of errors about failing to remove the temp/import directories early on, which are weird because I don't get why there are two of them (and there are indeed two identical import directories in temp containing identically sized entities.xml files. Then much later there was an UnresolvableObjectException. It may be relevant that the instance was (and is) doing a full re-index at the time. Afterwards, the space seemed to be somewhat intact but without any attachments. The stacktraces were: {noformat} 2011-10-11 00:47:25,434 ERROR [Long running task: Importing data] [sf.hibernate.impl.IteratorImpl] next could not get next result -- referer: https://extranet.atlassian.com/admin/backup.action | url: /admin/restore.action | userName: mhrynczak | act ion: restore net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 1948483595, of class: com.atlassi an.confluence.pages.Attachment at net.sf.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:38) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1962) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69) at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:208) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:130) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:93) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:127) at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao$IntraHibernateAttachm entCopier.copy(AbstractHibernateAttachmentDao.java:398) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importAttachments(FileBackupImporter.java: 335) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:1 15) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.doImportInternal(BackupImporter.java:108) at com.atlassian.confluence.importexport.Importer.doImport(Importer.java:74) at com.atlassian.confluence.importexport.DefaultImportExportManager.importAs(DefaultImportExportManager.java:67) 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: 182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy85.importAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ImportLongRunningTask.runInternal(ImportLongRunningTask.java:58 ) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunning Task.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) {noformat} and {noformat} 2011-10-11 00:47:25,434 ERROR [Long running task: Importing data] [sf.hibernate.impl.IteratorImpl] next could not get next result -- referer: https://extranet.atlassian.com/admin/backup.action | url: /admin/restore.action | userName: mhrynczak | action: restore net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:133) at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao$IntraHibernateAttachmentCopier.copy(AbstractHibernateAttachmentDao.java:398) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importAttachments(FileBackupImporter.java:335) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:115) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.doImportInternal(BackupImporter.java:108) at com.atlassian.confluence.importexport.Importer.doImport(Importer.java:74) at com.atlassian.confluence.importexport.DefaultImportExportManager.importAs(DefaultImportExportManager.java:67) 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:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy85.importAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ImportLongRunningTask.runInternal(ImportLongRunningTask.java:58) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 1948483595, of class: com.atlassian.confluence.pages.Attachment at net.sf.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:38) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1962) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69) at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:208) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:130) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:93) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:127) ... 26 more {noformat}

    Atlassian JIRA | 5 years ago | Don Willis [Atlassian]
    net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Mark H tried to import data into Extranet and it failed. There were a couple of errors about failing to remove the temp/import directories early on, which are weird because I don't get why there are two of them (and there are indeed two identical import directories in temp containing identically sized entities.xml files. Then much later there was an UnresolvableObjectException. It may be relevant that the instance was (and is) doing a full re-index at the time. Afterwards, the space seemed to be somewhat intact but without any attachments. The stacktraces were: {noformat} 2011-10-11 00:47:25,434 ERROR [Long running task: Importing data] [sf.hibernate.impl.IteratorImpl] next could not get next result -- referer: https://extranet.atlassian.com/admin/backup.action | url: /admin/restore.action | userName: mhrynczak | act ion: restore net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 1948483595, of class: com.atlassi an.confluence.pages.Attachment at net.sf.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:38) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1962) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69) at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:208) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:130) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:93) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:127) at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao$IntraHibernateAttachm entCopier.copy(AbstractHibernateAttachmentDao.java:398) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importAttachments(FileBackupImporter.java: 335) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:1 15) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.doImportInternal(BackupImporter.java:108) at com.atlassian.confluence.importexport.Importer.doImport(Importer.java:74) at com.atlassian.confluence.importexport.DefaultImportExportManager.importAs(DefaultImportExportManager.java:67) 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: 182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy85.importAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ImportLongRunningTask.runInternal(ImportLongRunningTask.java:58 ) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunning Task.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) {noformat} and {noformat} 2011-10-11 00:47:25,434 ERROR [Long running task: Importing data] [sf.hibernate.impl.IteratorImpl] next could not get next result -- referer: https://extranet.atlassian.com/admin/backup.action | url: /admin/restore.action | userName: mhrynczak | action: restore net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:133) at com.atlassian.confluence.pages.persistence.dao.hibernate.AbstractHibernateAttachmentDao$IntraHibernateAttachmentCopier.copy(AbstractHibernateAttachmentDao.java:398) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importAttachments(FileBackupImporter.java:335) at com.atlassian.confluence.importexport.xmlimport.FileBackupImporter.importEverything(FileBackupImporter.java:115) at com.atlassian.confluence.importexport.xmlimport.BackupImporter.doImportInternal(BackupImporter.java:108) at com.atlassian.confluence.importexport.Importer.doImport(Importer.java:74) at com.atlassian.confluence.importexport.DefaultImportExportManager.importAs(DefaultImportExportManager.java:67) 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:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy85.importAs(Unknown Source) at com.atlassian.confluence.importexport.actions.ImportLongRunningTask.runInternal(ImportLongRunningTask.java:58) at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:21) at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:35) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: 1948483595, of class: com.atlassian.confluence.pages.Attachment at net.sf.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:38) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1962) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69) at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:208) at net.sf.hibernate.type.EntityType.nullSafeGet(EntityType.java:130) at net.sf.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:93) at net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:127) ... 26 more {noformat}

    Atlassian JIRA | 5 years ago | Don Willis [Atlassian]
    net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem

    Root Cause Analysis

    1. net.sf.hibernate.LazyInitializationException

      Hibernate lazy instantiation problem

      at net.sf.hibernate.impl.IteratorImpl.next()
    2. net.sf.hibernate
      IteratorImpl.next
      1. net.sf.hibernate.impl.IteratorImpl.next(IteratorImpl.java:97)
      1 frame
    3. com.atlassian.confluence
      ViewSpaceAction.getRecentlyUpdatedContent
      1. com.atlassian.confluence.spaces.actions.ViewSpaceAction.getRecentlyUpdatedContent(ViewSpaceAction.java:104)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1068.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:324)
      3 frames
    5. OGNL - Object Graph Navigation Library
      OgnlRuntime.getProperty
      1. ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:321)
      2. ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:729)
      3. ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:54)
      4. ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:122)
      5. ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1444)
      5 frames
    6. XWork Tiger Extensions
      CompoundRootAccessor.getProperty
      1. com.opensymphony.xwork.util.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:98)
      1 frame
    7. OGNL - Object Graph Navigation Library
      Ognl.getValue
      1. ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1444)
      2. ognl.ASTProperty.getValueBody(ASTProperty.java:96)
      3. ognl.SimpleNode.getValue(SimpleNode.java:167)
      4. ognl.Ognl.getValue(Ognl.java:335)
      5. ognl.Ognl.getValue(Ognl.java:310)
      5 frames