org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jasig.cas.services.RegisteredServiceImpl.allowedAttributes, no session or session was closed

Apereo Issues | Marvin S. Addison | 7 years ago
  1. 0

    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.

    Apereo Issues | 7 years ago | Marvin S. Addison
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jasig.cas.services.RegisteredServiceImpl.allowedAttributes, no session or session was closed
  2. 0

    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.

    Apereo Issues | 7 years ago | Marvin S. Addison
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jasig.cas.services.RegisteredServiceImpl.allowedAttributes, no session or session was closed
  3. 0

    Why does EntityManager.merge() prevent LazyInitializationException while EntityManager.find() don't?

    Stack Overflow | 6 years ago | Zeemee
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: edeka.sw.phb.model.Chapter.subChapters, no session or session was closed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    {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}

    Atlassian JIRA | 11 months ago | Przemek Bruski
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.bamboo.commit.CommitImpl.files, no session or session was closed
  6. 0

    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}

    Atlassian JIRA | 10 years ago | Justin Koke
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.atlassian.crowd.model.application.Application.directories, 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. 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()
    2. Hibernate
      PersistentList.iterator
      1. org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380)
      2. org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372)
      3. org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365)
      4. org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
      5. org.hibernate.collection.PersistentList.iterator(PersistentList.java:138)
      5 frames
    3. Jasig CAS Core
      CentralAuthenticationServiceImpl.validateServiceTicket_aroundBody8
      1. org.jasig.cas.CentralAuthenticationServiceImpl.validateServiceTicket_aroundBody8(CentralAuthenticationServiceImpl.java:354)
      1 frame