org.hibernate.LazyInitializationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • This is the exception that is thrown: {noformat} 18:00:01,844 ERROR org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or session was closed org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:115) at com.atlassian.crowd.manager.license.CrowdLicenseManagerImpl.getCurrentResourceUsuageTotal(CrowdLicenseManagerImpl.java:141) at com.atlassian.crowd.license.LicenseResourceJob.getCurrentResourceTotal(LicenseResourceJob.java:125) at com.atlassian.crowd.license.LicenseResourceJob.executeInternal(LicenseResourceJob.java:38) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) 18:00:01,844 FATAL atlassian.crowd.manager.license.CrowdLicenseManagerImpl: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or sess ion was closed 18:00:01,844 FATAL com.atlassian.crowd.license.LicenseResourceJob: com.atlassian.crowd.manager.license.CrowdLicenseManagerException: Failed to calculate the current number of 'used' resources. {noformat}
    via by Justin Koke,
  • This is the exception that is thrown: {noformat} 18:00:01,844 ERROR org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or session was closed org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:115) at com.atlassian.crowd.manager.license.CrowdLicenseManagerImpl.getCurrentResourceUsuageTotal(CrowdLicenseManagerImpl.java:141) at com.atlassian.crowd.license.LicenseResourceJob.getCurrentResourceTotal(LicenseResourceJob.java:125) at com.atlassian.crowd.license.LicenseResourceJob.executeInternal(LicenseResourceJob.java:38) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520) 18:00:01,844 FATAL atlassian.crowd.manager.license.CrowdLicenseManagerImpl: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or sess ion was closed 18:00:01,844 FATAL com.atlassian.crowd.license.LicenseResourceJob: com.atlassian.crowd.manager.license.CrowdLicenseManagerException: Failed to calculate the current number of 'used' resources. {noformat}
    via by Justin Koke,
  • When a registered service is created with explicit access to attributes in the service manager (by selecting attributes in the "Attributes" field and de-selecting "Ignore Attribute Management via this Tool" checkbox), and the service registry is subsequently reloaded, all subsequent service ticket validations by _any_ service fail with an error like the following: 2010-03-23 13:04:04,963 WARN [org.jasig.cas] - Handler execution resulted in exception org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jasig.cas.services.RegisteredServiceImpl.allowedAttributes, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:138) at org.jasig.cas.CentralAuthenticationServiceImpl.validateServiceTicket_aroundBody8(CentralAuthenticationServiceImpl.java:354) ... Note that validation succeeds immediately after creating such a registered service, and the error above only manifests after the registry is reloaded by the Quartz scheduled job.
    via by Marvin S. Addison,
  • {code} 2016-01-04 12:19:52,724 ERROR [10-BAM::PlanExec:pool-17-thread-4] [AfterSuccessfulPlanEnvironmentTriggeringAction] Error while triggering environment org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.bamboo.commit.CommitImpl.files, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:138) at com.atlassian.bamboo.commit.CommitImpl.guessChangeSetId(CommitImpl.java:96) at com.atlassian.bamboo.deployments.versions.persistence.commits.MutableDeploymentVersionVcsChangesetImpl$BuildCommit2DeploymentCommit.apply(MutableDeploymentVersionVcsChangesetImpl.java:42) at com.atlassian.bamboo.deployments.versions.persistence.commits.MutableDeploymentVersionVcsChangesetImpl$BuildCommit2DeploymentCommit.apply(MutableDeploymentVersionVcsChangesetImpl.java:30) at com.google.common.collect.Iterators$8.next(Iterators.java:812) at com.google.common.collect.Iterators.addAll(Iterators.java:356) at com.google.common.collect.Iterables.addAll(Iterables.java:332) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.addChangesetToMap(DeploymentVersionChainResultDataCollectorImpl.java:151) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.createChangesetsFromRange(DeploymentVersionChainResultDataCollectorImpl.java:133) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.findChangesetsAndJiraIssues(DeploymentVersionChainResultDataCollectorImpl.java:249) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.createChangesetsAndJiraIssues(DeploymentVersionChainResultDataCollectorImpl.java:171) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.createDeploymentVersionInternal(DeploymentVersionServiceImpl.java:315) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.access$000(DeploymentVersionServiceImpl.java:98) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$1.apply(DeploymentVersionServiceImpl.java:264) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$1.apply(DeploymentVersionServiceImpl.java:259) at com.atlassian.bamboo.core.ScopedExclusionServiceImpl.withLock(ScopedExclusionServiceImpl.java:75) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.getOrCreateDeploymentVersion(DeploymentVersionServiceImpl.java:258) at com.atlassian.bamboo.deployments.execution.triggering.AfterSuccessfulPlanEnvironmentTriggeringAction.createDeploymentContext(AfterSuccessfulPlanEnvironmentTriggeringAction.java:113) at com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl$1.call(DeploymentExecutionServiceImpl.java:239) at com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl$1.call(DeploymentExecutionServiceImpl.java:233) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312) at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:85) at com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl.execute(DeploymentExecutionServiceImpl.java:232) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$5.call(PlanExecutionManagerImpl.java:637) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$5.call(PlanExecutionManagerImpl.java:626) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312) at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:85) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:800) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startDeployment(PlanExecutionManagerImpl.java:625) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:610) at com.atlassian.bamboo.plan.DelegatingPlanExecutionManager.start(DelegatingPlanExecutionManager.java:95) at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$2.call(NonBlockingPlanExecutionServiceImpl.java:98) at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$2.call(NonBlockingPlanExecutionServiceImpl.java:91) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) {code}
    via by Przemek Bruski,
  • When a registered service is created with explicit access to attributes in the service manager (by selecting attributes in the "Attributes" field and de-selecting "Ignore Attribute Management via this Tool" checkbox), and the service registry is subsequently reloaded, all subsequent service ticket validations by _any_ service fail with an error like the following: 2010-03-23 13:04:04,963 WARN [org.jasig.cas] - Handler execution resulted in exception org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jasig.cas.services.RegisteredServiceImpl.allowedAttributes, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:138) at org.jasig.cas.CentralAuthenticationServiceImpl.validateServiceTicket_aroundBody8(CentralAuthenticationServiceImpl.java:354) ... Note that validation succeeds immediately after creating such a registered service, and the error above only manifests after the registry is reloaded by the Quartz scheduled job.
    via by Marvin S. Addison,
  • {code} 2016-01-04 12:19:52,724 ERROR [10-BAM::PlanExec:pool-17-thread-4] [AfterSuccessfulPlanEnvironmentTriggeringAction] Error while triggering environment org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.bamboo.commit.CommitImpl.files, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:138) at com.atlassian.bamboo.commit.CommitImpl.guessChangeSetId(CommitImpl.java:96) at com.atlassian.bamboo.deployments.versions.persistence.commits.MutableDeploymentVersionVcsChangesetImpl$BuildCommit2DeploymentCommit.apply(MutableDeploymentVersionVcsChangesetImpl.java:42) at com.atlassian.bamboo.deployments.versions.persistence.commits.MutableDeploymentVersionVcsChangesetImpl$BuildCommit2DeploymentCommit.apply(MutableDeploymentVersionVcsChangesetImpl.java:30) at com.google.common.collect.Iterators$8.next(Iterators.java:812) at com.google.common.collect.Iterators.addAll(Iterators.java:356) at com.google.common.collect.Iterables.addAll(Iterables.java:332) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.addChangesetToMap(DeploymentVersionChainResultDataCollectorImpl.java:151) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.createChangesetsFromRange(DeploymentVersionChainResultDataCollectorImpl.java:133) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.findChangesetsAndJiraIssues(DeploymentVersionChainResultDataCollectorImpl.java:249) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionChainResultDataCollectorImpl.createChangesetsAndJiraIssues(DeploymentVersionChainResultDataCollectorImpl.java:171) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.createDeploymentVersionInternal(DeploymentVersionServiceImpl.java:315) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.access$000(DeploymentVersionServiceImpl.java:98) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$1.apply(DeploymentVersionServiceImpl.java:264) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl$1.apply(DeploymentVersionServiceImpl.java:259) at com.atlassian.bamboo.core.ScopedExclusionServiceImpl.withLock(ScopedExclusionServiceImpl.java:75) at com.atlassian.bamboo.deployments.versions.service.DeploymentVersionServiceImpl.getOrCreateDeploymentVersion(DeploymentVersionServiceImpl.java:258) at com.atlassian.bamboo.deployments.execution.triggering.AfterSuccessfulPlanEnvironmentTriggeringAction.createDeploymentContext(AfterSuccessfulPlanEnvironmentTriggeringAction.java:113) at com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl$1.call(DeploymentExecutionServiceImpl.java:239) at com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl$1.call(DeploymentExecutionServiceImpl.java:233) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312) at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:85) at com.atlassian.bamboo.deployments.execution.service.DeploymentExecutionServiceImpl.execute(DeploymentExecutionServiceImpl.java:232) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$5.call(PlanExecutionManagerImpl.java:637) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$5.call(PlanExecutionManagerImpl.java:626) at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:312) at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:85) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:800) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startDeployment(PlanExecutionManagerImpl.java:625) at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:610) at com.atlassian.bamboo.plan.DelegatingPlanExecutionManager.start(DelegatingPlanExecutionManager.java:95) at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$2.call(NonBlockingPlanExecutionServiceImpl.java:98) at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$2.call(NonBlockingPlanExecutionServiceImpl.java:91) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:49) at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31) at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20) at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52) at java.lang.Thread.run(Thread.java:745) {code}
    via by Przemek Bruski,
    • org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, no session or session was closed at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358) at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.PersistentList.iterator(PersistentList.java:115) at com.atlassian.crowd.manager.license.CrowdLicenseManagerImpl.getCurrentResourceUsuageTotal(CrowdLicenseManagerImpl.java:141) at com.atlassian.crowd.license.LicenseResourceJob.getCurrentResourceTotal(LicenseResourceJob.java:125) at com.atlassian.crowd.license.LicenseResourceJob.executeInternal(LicenseResourceJob.java:38) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90) at org.quartz.core.JobRunShell.run(JobRunShell.java:195) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    mauritiusmauritius
    2 times, last one,
    treefolktreefolk
    2 times, last one,
    mortalman7mortalman7
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    9 more bugmates