org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.vmware.bdd.entity.VcResourcePoolEntity.hadoopNodes, no session or session was closed

SpringSource Issue Tracker | Emma Lin | 4 years ago
  1. 0

    If cluster is created, and referenced one resource pool. IResourcePoolService.getAllResourcePoolForRest() will throw exception as following: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.vmware.bdd.entity.VcResourcePoolEntity.hadoopNodes, 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.readSize(AbstractPersistentCollection.java:122) at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:169) at com.vmware.bdd.entity.VcResourcePoolEntity.toRest(VcResourcePoolEntity.java:110) at com.vmware.bdd.service.resmgmt.impl.ResourcePoolService.getAllResourcePoolForRest(ResourcePoolService.java:219) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.vmware.bdd.manager.TestClusteringJobs.testResourcePoolList(TestClusteringJobs.java:381) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.lang.reflect.Method.invoke(Method.java:597) Suppose this error can be reproduced in CLI.

    SpringSource Issue Tracker | 4 years ago | Emma Lin
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.vmware.bdd.entity.VcResourcePoolEntity.hadoopNodes, no session or session was closed
  2. 0

    If cluster is created, and referenced one resource pool. IResourcePoolService.getAllResourcePoolForRest() will throw exception as following: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.vmware.bdd.entity.VcResourcePoolEntity.hadoopNodes, 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.readSize(AbstractPersistentCollection.java:122) at org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:169) at com.vmware.bdd.entity.VcResourcePoolEntity.toRest(VcResourcePoolEntity.java:110) at com.vmware.bdd.service.resmgmt.impl.ResourcePoolService.getAllResourcePoolForRest(ResourcePoolService.java:219) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.vmware.bdd.manager.TestClusteringJobs.testResourcePoolList(TestClusteringJobs.java:381) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.lang.reflect.Method.invoke(Method.java:597) Suppose this error can be reproduced in CLI.

    SpringSource Issue Tracker | 4 years ago | Emma Lin
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.vmware.bdd.entity.VcResourcePoolEntity.hadoopNodes, no session or session was closed
  3. 0

    Error on HQL query with parameter

    Stack Overflow | 4 years ago | Mike HT
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: edu.univ.mht.domain.Course.students, no session or session was closed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Initialization of collection throws LazyInitializationException

    Stack Overflow | 3 years ago | misco
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.app.cloud.hibernate.Product.availabilities, no session or session was closed
  6. 0

    failed to lazily initialize a collection when no value in DB

    Stack Overflow | 12 months ago | Kirikou
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: Cat.listeDomain - no session or session was closed

  1. mortalman7 1 times, last 4 months ago
2 unregistered visitors
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: com.vmware.bdd.entity.VcResourcePoolEntity.hadoopNodes, no session or session was closed

    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException()
  2. Hibernate
    PersistentSet.isEmpty
    1. org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
    2. org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
    3. org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122)
    4. org.hibernate.collection.PersistentSet.isEmpty(PersistentSet.java:169)
    4 frames
  3. com.vmware.bdd
    ResourcePoolService.getAllResourcePoolForRest
    1. com.vmware.bdd.entity.VcResourcePoolEntity.toRest(VcResourcePoolEntity.java:110)
    2. com.vmware.bdd.service.resmgmt.impl.ResourcePoolService.getAllResourcePoolForRest(ResourcePoolService.java:219)
    2 frames
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:597)
    2 frames
  5. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
    2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    4. org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
    5. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
    6. org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
    7. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    8. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    8 frames
  6. com.vmware.bdd
    TestClusteringJobs.testResourcePoolList
    1. com.vmware.bdd.manager.TestClusteringJobs.testResourcePoolList(TestClusteringJobs.java:381)
    1 frame
  7. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:597)
    2 frames