org.hibernate.LazyInitializationException

failed to lazily initialize a collection of role: com.atlassian.bamboo.commit.CommitImpl.files, no session or session was closed

Solutions on the web712

  • via Atlassian JIRA by Przemek Bruski, 1 year ago
    failed to lazily initialize a collection of role: com.atlassian.bamboo.commit.CommitImpl.files, no session or session was closed
  • via Atlassian JIRA by Przemek Bruski, 1 year ago
    failed to lazily initialize a collection of role: com.atlassian.bamboo.commit.CommitImpl.files, no session or session was closed
  • via Coderanch by ayan sevi, 7 months ago
    failed to lazily initialize a collection of role: com.sample.model.User.accounts, no session or session was closed
  • Stack trace

    • 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)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown user
    Once, 4 months ago
    2 times, 4 months ago
    2 times, 8 months ago
    Once, 11 months ago
    Unknown user
    Once, 1 year ago
    9 more bugmates