net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection

Atlassian JIRA | Simon Jones | 1 decade ago
  1. 0

    Deleting a user generates a net.sf.hibernate.LazyInitializationException. After this you cannot enter the 'browse' user screen. The user is deleted succesfully, but you need to restart the app server to get things behaving again. We're using LDAP against ActiveDirectory for some users; this might be relevant. We also had this problem in 1.1.2 but didn't report as I thought it might have gone away in 1.3. Here's the relevant bit of the stack trace: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:201) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Set.size(Set.java:106) at com.opensymphony.user.provider.hibernate.entity.HibernateGroup.getUserNameList(HibernateGroup.java:33) at com.opensymphony.user.provider.hibernate.HibernateAccessProvider.listUsersInGroup(HibernateAccessProvider.java:151) at bucket.user.providers.ChainedAccessProvider.listUsersInGroup(ChainedAccessProvider.java:45) at com.opensymphony.user.Group.getUsers(Group.java:65) at com.atlassian.confluence.user.DefaultUserAccessor.getActiveUsers(DefaultUserAccessor.java:168) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116) at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152) at $Proxy8.getActiveUsers(Unknown Source) at com.atlassian.confluence.user.actions.BrowseUsersAction.getUsers(BrowseUsersAction.java:65) at com.atlassian.confluence.user.actions.BrowseUsersAction.execute(BrowseUsersAction.java:46) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)

    Atlassian JIRA | 1 decade ago | Simon Jones
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection
  2. 0

    Deleting a user generates a net.sf.hibernate.LazyInitializationException. After this you cannot enter the 'browse' user screen. The user is deleted succesfully, but you need to restart the app server to get things behaving again. We're using LDAP against ActiveDirectory for some users; this might be relevant. We also had this problem in 1.1.2 but didn't report as I thought it might have gone away in 1.3. Here's the relevant bit of the stack trace: net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:201) at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71) at net.sf.hibernate.collection.Set.size(Set.java:106) at com.opensymphony.user.provider.hibernate.entity.HibernateGroup.getUserNameList(HibernateGroup.java:33) at com.opensymphony.user.provider.hibernate.HibernateAccessProvider.listUsersInGroup(HibernateAccessProvider.java:151) at bucket.user.providers.ChainedAccessProvider.listUsersInGroup(ChainedAccessProvider.java:45) at com.opensymphony.user.Group.getUsers(Group.java:65) at com.atlassian.confluence.user.DefaultUserAccessor.getActiveUsers(DefaultUserAccessor.java:168) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116) at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152) at $Proxy8.getActiveUsers(Unknown Source) at com.atlassian.confluence.user.actions.BrowseUsersAction.getUsers(BrowseUsersAction.java:65) at com.atlassian.confluence.user.actions.BrowseUsersAction.execute(BrowseUsersAction.java:46) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)

    Atlassian JIRA | 1 decade ago | Simon Jones
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection
  3. 0

    getting a "Failed to lazily" error...

    xplanner | 9 years ago | krherrmann
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    OpenSessionInViewInterceptor Spring MVC prob

    springframework | 1 decade ago | chrisnam1208
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection
  6. 0

    Users missing from after upgrade to 0.6.1

    xplanner | 1 decade ago | *anonymous
    net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection

    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

      at net.sf.hibernate.collection.PersistentCollection.initialize()
    2. net.sf.hibernate
      Set.size
      1. net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:201)
      2. net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
      3. net.sf.hibernate.collection.Set.size(Set.java:106)
      3 frames
    3. com.opensymphony.user
      HibernateAccessProvider.listUsersInGroup
      1. com.opensymphony.user.provider.hibernate.entity.HibernateGroup.getUserNameList(HibernateGroup.java:33)
      2. com.opensymphony.user.provider.hibernate.HibernateAccessProvider.listUsersInGroup(HibernateAccessProvider.java:151)
      2 frames
    4. bucket.user.providers
      ChainedAccessProvider.listUsersInGroup
      1. bucket.user.providers.ChainedAccessProvider.listUsersInGroup(ChainedAccessProvider.java:45)
      1 frame
    5. com.opensymphony.user
      Group.getUsers
      1. com.opensymphony.user.Group.getUsers(Group.java:65)
      1 frame
    6. com.atlassian.confluence
      DefaultUserAccessor.getActiveUsers
      1. com.atlassian.confluence.user.DefaultUserAccessor.getActiveUsers(DefaultUserAccessor.java:168)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    8. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:116)
      3 frames
    9. com.atlassian.confluence
      SpringProfilingInterceptor.invoke
      1. com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)
      1 frame
    10. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
      1 frame
    11. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
      1 frame
    12. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)
      2 frames
    13. Unknown
      $Proxy8.getActiveUsers
      1. $Proxy8.getActiveUsers(Unknown Source)
      1 frame
    14. com.atlassian.confluence
      BrowseUsersAction.execute
      1. com.atlassian.confluence.user.actions.BrowseUsersAction.getUsers(BrowseUsersAction.java:65)
      2. com.atlassian.confluence.user.actions.BrowseUsersAction.execute(BrowseUsersAction.java:46)
      2 frames
    15. XWork Tiger Extensions
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
      1 frame