net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed

Atlassian JIRA | James Dumay [Atlassian] | 6 years ago
  1. 0

    In Plan http://tardigrade.sydney.atlassian.com:8085/bamboo/build/result/gotoBuildResult.action?returnUrl=%2Fbrowse%2FBAM-FC-3567&buildKey=BAM-FC&buildNumber=3566 {noformat} net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.write(PersistentCollection.java:84) at net.sf.hibernate.collection.Map.put(Map.java:124) at com.atlassian.bamboo.plugins.brmp.action.BRMPPreChainAction.execute(BRMPPreChainAction.java:134) at com.atlassian.bamboo.chains.ChainPluginSupportImpl.chainStarted(ChainPluginSupportImpl.java:67) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.start(ChainExecutionManagerImpl.java:113) at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) 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:304) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) at $Proxy49.start(Unknown Source) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startWithLockTaken(PlanExecutionManagerImpl.java:174) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$100(PlanExecutionManagerImpl.java:39) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$2.call(PlanExecutionManagerImpl.java:155) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:306) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:148) at com.atlassian.bamboo.v2.trigger.ChangeDetectionListener.handleEvent(ChangeDetectionListener.java:50) at com.atlassian.event.legacy.LegacyListenerHandler$LegacyListenerInvoker.invoke(LegacyListenerHandler.java:55) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:60) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50) at java.lang.Thread.run(Thread.java:637) {noformat}

    Atlassian JIRA | 6 years ago | James Dumay [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed
  2. 0

    In Plan http://tardigrade.sydney.atlassian.com:8085/bamboo/build/result/gotoBuildResult.action?returnUrl=%2Fbrowse%2FBAM-FC-3567&buildKey=BAM-FC&buildNumber=3566 {noformat} net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.write(PersistentCollection.java:84) at net.sf.hibernate.collection.Map.put(Map.java:124) at com.atlassian.bamboo.plugins.brmp.action.BRMPPreChainAction.execute(BRMPPreChainAction.java:134) at com.atlassian.bamboo.chains.ChainPluginSupportImpl.chainStarted(ChainPluginSupportImpl.java:67) at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.start(ChainExecutionManagerImpl.java:113) at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) 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:304) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) at $Proxy49.start(Unknown Source) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startWithLockTaken(PlanExecutionManagerImpl.java:174) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$100(PlanExecutionManagerImpl.java:39) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$2.call(PlanExecutionManagerImpl.java:155) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:306) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:148) at com.atlassian.bamboo.v2.trigger.ChangeDetectionListener.handleEvent(ChangeDetectionListener.java:50) at com.atlassian.event.legacy.LegacyListenerHandler$LegacyListenerInvoker.invoke(LegacyListenerHandler.java:55) at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:60) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50) at java.lang.Thread.run(Thread.java:637) {noformat}

    Atlassian JIRA | 6 years ago | James Dumay [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed
  3. 0

    {code} 2008-02-10 00:00:00,163 INFO [QuartzScheduler_Worker-4] [BuildExpiryBean] Found 59 builds to expire. 2008-02-10 00:00:00,164 ERROR [QuartzScheduler_Worker-4] [LazyInitializationException] Failed to lazily initialize a collection - no session or session was closed net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Bag.iterator(Bag.java:256) at com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl.getLabelNames(BuildResultsSummaryImpl.java:213) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.excludedDueToLabel(BuildExpiryBean.java:197) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.expireBuild(BuildExpiryBean.java:160) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.expireAllBuilds(BuildExpiryBean.java:86) at com.atlassian.bamboo.build.expiry.ExpiredBuildCleaner.execute(ExpiredBuildCleaner.java:25) at org.quartz.core.JobRunShell.run(JobRunShell.java:203) at com.atlassian.bamboo.quartz.SystemAuthorizedThreadPool$1.run(SystemAuthorizedThreadPool.java:36) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) 2008-02-10 00:00:00,167 ERROR [QuartzScheduler_Worker-4] [JobRunShell] Job DEFAULT.removeExpiredBuilds threw an unhandled Exception: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Bag.iterator(Bag.java:256) at com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl.getLabelNames(BuildResultsSummaryImpl.java:213) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.excludedDueToLabel(BuildExpiryBean.java:197) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.expireBuild(BuildExpiryBean.java:160) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.expireAllBuilds(BuildExpiryBean.java:86) at com.atlassian.bamboo.build.expiry.ExpiredBuildCleaner.execute(ExpiredBuildCleaner.java:25) at org.quartz.core.JobRunShell.run(JobRunShell.java:203) at com.atlassian.bamboo.quartz.SystemAuthorizedThreadPool$1.run(SystemAuthorizedThreadPool.java:36) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) 2008-02-10 00:00:00,170 ERROR [QuartzScheduler_Worker-4] [ErrorLogger] Job (DEFAULT.removeExpiredBuilds threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed] at org.quartz.core.JobRunShell.run(JobRunShell.java:214) at com.atlassian.bamboo.quartz.SystemAuthorizedThreadPool$1.run(SystemAuthorizedThreadPool.java:36) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) * Nested Exception (Underlying Cause) --------------- net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Bag.iterator(Bag.java:256) at com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl.getLabelNames(BuildResultsSummaryImpl.java:213) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.excludedDueToLabel(BuildExpiryBean.java:197) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.expireBuild(BuildExpiryBean.java:160) at com.atlassian.bamboo.build.expiry.BuildExpiryBean.expireAllBuilds(BuildExpiryBean.java:86) at com.atlassian.bamboo.build.expiry.ExpiredBuildCleaner.execute(ExpiredBuildCleaner.java:25) at org.quartz.core.JobRunShell.run(JobRunShell.java:203) at com.atlassian.bamboo.quartz.SystemAuthorizedThreadPool$1.run(SystemAuthorizedThreadPool.java:36) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520){code}

    Atlassian JIRA | 9 years ago | Ajay Sridhar [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Enabling caching for hibernate repository by adding the *cache="true"* directive in the atlassian-user.xml file, such as this: {noformat} <hibernate name="Hibernate Repository" key="hibernateRepository" description="Hibernate Repository" cache="true" /> {noformat} leads to the following exception: {noformat} Cause: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) Stack Trace: [hide] net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Set.contains(Set.java:122) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasExternalMembership(HibernateGroupManager.java:461) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasMembership(HibernateGroupManager.java:437) at com.atlassian.user.impl.cache.CachingGroupManager.hasMembership(CachingGroupManager.java:149) at com.atlassian.user.impl.delegation.DelegatingGroupManagerTemplate.hasMembership(DelegatingGroupManagerTemplate.java:189) {noformat}

    Atlassian JIRA | 9 years ago | Gurleen Anand [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed
  6. 0

    Enabling caching for hibernate repository by adding the *cache="true"* directive in the atlassian-user.xml file, such as this: {noformat} <hibernate name="Hibernate Repository" key="hibernateRepository" description="Hibernate Repository" cache="true" /> {noformat} leads to the following exception: {noformat} Cause: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) Stack Trace: [hide] net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Set.contains(Set.java:122) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasExternalMembership(HibernateGroupManager.java:461) at com.atlassian.user.impl.hibernate.HibernateGroupManager.hasMembership(HibernateGroupManager.java:437) at com.atlassian.user.impl.cache.CachingGroupManager.hasMembership(CachingGroupManager.java:149) at com.atlassian.user.impl.delegation.DelegatingGroupManagerTemplate.hasMembership(DelegatingGroupManagerTemplate.java:189) {noformat}

    Atlassian JIRA | 9 years ago | Gurleen Anand [Atlassian]
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed

    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. net.sf.hibernate.LazyInitializationException

      Failed to lazily initialize a collection - no session or session was closed

      at net.sf.hibernate.collection.PersistentCollection.initialize()
    2. net.sf.hibernate
      Map.put
      1. net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209)
      2. net.sf.hibernate.collection.PersistentCollection.write(PersistentCollection.java:84)
      3. net.sf.hibernate.collection.Map.put(Map.java:124)
      3 frames
    3. com.atlassian.bamboo
      ChainExecutionManagerImpl.start
      1. com.atlassian.bamboo.plugins.brmp.action.BRMPPreChainAction.execute(BRMPPreChainAction.java:134)
      2. com.atlassian.bamboo.chains.ChainPluginSupportImpl.chainStarted(ChainPluginSupportImpl.java:67)
      3. com.atlassian.bamboo.chains.ChainExecutionManagerImpl.start(ChainExecutionManagerImpl.java:113)
      3 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    5. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
      2 frames
    6. Unknown
      $Proxy49.start
      1. $Proxy49.start(Unknown Source)
      1 frame
    7. com.atlassian.bamboo
      ChangeDetectionListener.handleEvent
      1. com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startWithLockTaken(PlanExecutionManagerImpl.java:174)
      2. com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$100(PlanExecutionManagerImpl.java:39)
      3. com.atlassian.bamboo.plan.PlanExecutionManagerImpl$2.call(PlanExecutionManagerImpl.java:155)
      4. com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:306)
      5. com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:148)
      6. com.atlassian.bamboo.v2.trigger.ChangeDetectionListener.handleEvent(ChangeDetectionListener.java:50)
      6 frames
    8. com.atlassian.event
      AsynchronousAbleEventDispatcher$2.run
      1. com.atlassian.event.legacy.LegacyListenerHandler$LegacyListenerInvoker.invoke(LegacyListenerHandler.java:55)
      2. com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:60)
      2 frames
    9. Java RT
      ThreadPoolExecutor$Worker.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      2 frames
    10. com.atlassian.bamboo
      NamedThreadFactory$2.run
      1. com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50)
      1 frame
    11. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:637)
      1 frame