LazyInitializationException when accessing sample wiki pages that comes with Confluence

[net.sf.hibernate.LazyInitializationException] <init> Failed to lazily initialize a collection - no session or session was closed -- page: 98309 | contextPath: /confluence | action: viewpage
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.iterator(Bag.java:256)
    at com.atlassian.confluence.util.LabelUtil.extractLabelsFromLabellings(LabelUtil.java:516)
    at com.atlassian.confluence.core.AbstractLabelableEntityObject.getLabels(AbstractLabelableEntityObject.java:28)
    at com.atlassian.confluence.labels.PermittedLabelView.getVisibleLabels(PermittedLabelView.java:62)
    at com.atlassian.confluence.labels.PermittedLabelView.getLabels(PermittedLabelView.java:34)
    at com.atlassian.confluence.core.AbstractLabelableEntityObject.getVisibleLabels(AbstractLabelableEntityObject.java:63)
    at com.atlassian.confluence.pages.actions.AbstractPageAction.getLabels(AbstractPageAction.java:323)
    at com.atlassian.confluence.pages.actions.AbstractPageAction.getNumberOfLabelsAsString(AbstractPageAction.java:333)
    at com.atlassian.confluence.pages.actions.AbstractPageAction.getWebInterfaceContext(AbstractPageAction.java:308)
    at com.atlassian.confluence.pages.actions.ViewPageAction.getWebInterfaceContext(ViewPageAction.java:734)
    at sun.reflect.GeneratedMethodAccessor413.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
    at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:533)
    at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
    at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
    at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507)
    at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:155)
    at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
    at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507)
    at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:282)
    at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
    at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
    at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
    at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
    at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
    at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
    at org.apache.velocity.runtime.directive.Parse.render(Parse.java:263)
    at com.atlassian.confluence.setup.velocity.ProfilingParseDirective.render(ProfilingParseDirective.java:24)
    at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
    at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
    at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
    at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
    at org.apache.velocity.Template.merge(Template.java:328)
    at org.apache.velocity.Template.merge(Template.java:235)
    at com.atlassian.confluence.util.velocity.VelocityUtils.renderTemplateWithoutSwallowingErrors(VelocityUtils.java:84)
    at com.atlassian.confluence.util.velocity.VelocityUtils.renderTemplateWithoutSwallowingErrors(VelocityUtils.java:95)
    at com.atlassian.confluence.util.velocity.VelocityUtils.getRenderedTemplateWithoutSwallowingErrors(VelocityUtils.java:73)
    at com.atlassian.confluence.setup.velocity.ApplyDecoratorDirective.render(ApplyDecoratorDirective.java:182)
    at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
    at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
    at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
    at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
    at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
    at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
....

Hi


On confluence 5.3, when installed with the sample wiki, accessing one of the sample wiki pages, i got this.
it might be when velocity rendering it somehow access a hibernate entity that when hibernate session is already out of scope.
From the wiki it says somehting like confluence only wrap transaction capabilities on manager, anyway anyone seeing
as well? or is it just me ....

Thanks in advance .

1 answer

This sample page that you were referring to, is it coming from Demonstration Space? Usually this happened because there is a layout customization in place that's interfering with the process. can you check on the space level from the space setting if there's any layout customization in place? If there is, back it up, reset the setting back to default and see how it goes.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,945 views 27 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you