net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Atlassian JIRA by Jon Nermut, 1 year ago
Failed to lazily initialize a collection - no session or session was closed
via Atlassian JIRA by Jon Nermut, 1 year ago
Failed to lazily initialize a collection - no session or session was closed
via Atlassian JIRA by Janusz Gorycki [Atlassian], 1 year ago
Failed to lazily initialize a collection - no session or session was closed
via Atlassian JIRA by Janusz Gorycki [Atlassian], 1 year ago
Failed to lazily initialize a collection - no session or session was closed
via Atlassian JIRA by Belinda Teh [Atlassian], 1 year ago
Failed to lazily initialize a collection - no session or session was closed
via Atlassian JIRA by Geoffrey Wong [Atlassian], 1 year ago
Failed to lazily initialize a collection - no session or session was closed
net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a collection - no session or session was closed
at net.sf.hibernate.collection.PersistentCollection.initialize(PersistentCollection.java:209)
at net.sf.hibernate.collection.PersistentCollection.read(PersistentCollection.java:71)
at net.sf.hibernate.collection.Bag.contains(Bag.java:248)
at com.atlassian.confluence.security.CachingSpacePermissionManager.hasPermissionInDao(CachingSpacePermissionManager.java:40)
at com.atlassian.confluence.security.DefaultSpacePermissionManager.hasPermissionAsAnonymousUser(DefaultSpacePermissionManager.java:308)
at com.atlassian.confluence.security.DefaultSpacePermissionManager.hasPermission(DefaultSpacePermissionManager.java:94)
at com.atlassian.confluence.security.SpacePermissionCheckDispatcherCoordinator.hasPermission(SpacePermissionCheckDispatcherCoordinator.java:38)
at sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149)
at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:18)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
at com.atlassian.confluence.security.delegate.AbstractPermissionsDelegate.hasSpaceLevelPermission(AbstractPermissionsDelegate.java:19)
at com.atlassian.confluence.security.delegate.PagePermissionsDelegate.canView(PagePermissionsDelegate.java:17)
at com.atlassian.confluence.security.Permission$1.checkAgainst(Permission.java:20)
at com.atlassian.confluence.security.DefaultPermissionManager.hasPermission(DefaultPermissionManager.java:31)
at com.atlassian.confluence.security.delegate.AttachmentPermissionsDelegate.canView(AttachmentPermissionsDelegate.java:24)
at com.atlassian.confluence.security.Permission$1.checkAgainst(Permission.java:20)
at com.atlassian.confluence.security.DefaultPermissionManager.hasPermission(DefaultPermissionManager.java:31)
at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149)
at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:18)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
at com.atlassian.confluence.renderer.attachments.RendererAttachmentManager.isPermittedToViewAttachment(RendererAttachmentManager.java:148)
at com.atlassian.confluence.renderer.attachments.RendererAttachmentManager.getAttachment(RendererAttachmentManager.java:40)
at com.atlassian.renderer.embedded.DefaultEmbeddedResourceRenderer.renderResource(DefaultEmbeddedResourceRenderer.java:38)
at com.atlassian.renderer.v2.components.EmbeddedRendererComponent.appendSubstitution(EmbeddedRendererComponent.java:51)
at com.atlassian.renderer.v2.components.AbstractRegexRendererComponent.regexRender(AbstractRegexRendererComponent.java:32)
at com.atlassian.renderer.v2.components.EmbeddedRendererComponent.render(EmbeddedRendererComponent.java:32)
at com.atlassian.renderer.v2.V2Renderer.render(V2Renderer.java:54)
at com.atlassian.renderer.v2.V2SubRenderer.render(V2SubRenderer.java:44)
at com.atlassian.renderer.v2.components.block.BlockRendererComponent.renderParagraph(BlockRendererComponent.java:99)
at com.atlassian.renderer.v2.components.block.BlockRendererComponent.flushParagraph(BlockRendererComponent.java:90)
at com.atlassian.renderer.v2.components.block.BlockRendererComponent.render(BlockRendererComponent.java:74)
at com.atlassian.renderer.v2.V2Renderer.render(V2Renderer.java:54)
at com.atlassian.renderer.v2.V2RendererFacade.convertWikiToXHtml(V2RendererFacade.java:57)
at sun.reflect.GeneratedMethodAccessor309.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.framework.AopProxyUtils.invokeJoinpointUsingReflection(AopProxyUtils.java:61)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:149)
at com.atlassian.confluence.util.profiling.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:18)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
at com.atlassian.confluence.renderer.DefaultWikiStyleRenderer.convertWikiToXHtml(DefaultWikiStyleRenderer.java:23)
at com.atlassian.confluence.pages.actions.ViewPageAction.execute(ViewPageAction.java:118)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.intercept(DefaultWorkflowInterceptor.java:55)
at com.atlassian.confluence.core.ConfluenceWorkflowInterceptor.intercept(ConfluenceWorkflowInterceptor.java:39)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.atlassian.confluence.core.ConfluenceValidationInterceptor.intercept(ConfluenceValidationInterceptor.java:16)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.security.actions.PermissionCheckInterceptor.intercept(PermissionCheckInterceptor.java:39)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.pages.actions.PageAwareInterceptor.intercept(PageAwareInterceptor.java:114)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.spaces.actions.SpaceAwareInterceptor.intercept(SpaceAwareInterceptor.java:82)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.core.actions.LastModifiedInterceptor.intercept(LastModifiedInterceptor.java:39)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.core.ConfluenceAutowireInterceptor.intercept(ConfluenceAutowireInterceptor.java:25)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.util.XWorkTransactionInterceptor.intercept(XWorkTransactionInterceptor.java:133)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:229)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.atlassian.confluence.servlet.simpledisplay.SimpleDisplayServlet.doGet(SimpleDisplayServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at com.atlassian.confluence.util.profiling.ProfilingPageFilter.parsePage(ProfilingPageFilter.java:143)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.confluence.util.ServletContextThreadLocalFilter.doFilter(ServletContextThreadLocalFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.confluence.util.UserThreadLocalFilter.doFilter(UserThreadLocalFilter.java:45)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:182)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.seraph.filter.LoginFilter.doFilter(LoginFilter.java:181)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.johnson.filters.JohnsonFilter.doFilter(JohnsonFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at bucket.custom.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingFilter.java:122)
at com.atlassian.confluence.util.error.ProfilingAndErrorFilter.doFilter(ProfilingAndErrorFilter.java:27)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.core.filters.gzip.GzipFilter.doFilter(GzipFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at com.atlassian.core.filters.AbstractEncodingFilter.doFilter(AbstractEncodingFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:744)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:674)
at java.lang.Thread.run(Thread.java:595)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

Know the solutions? Share your knowledge to help other developers to debug faster.