org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, 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 Hibernate JIRA by Bayo Erinle, 1 year ago
failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, no session or session was closed
via Hibernate JIRA by Bayo Erinle, 1 year ago
failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, no session or session was closed
via Stack Overflow by benhsu
, 2 years ago
failed to lazily initialize a collection of role: com.companyname.apps.manager.domain.PriceChangeset.priceChanges, no session or session was closed
via Stack Overflow by Reddy
, 2 years ago
failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsWcru.trains, no session or session was closed
via csdn.net by Unknown author, 1 year ago
failed to lazily initialize a collection of role: org.joshua.ss.entity.SysUsers.sysUsersRoleses, no session or session was closed
via javamonamour.org by Unknown author, 2 years ago
failed to lazily initialize a collection of role: acme.domain.model.Bla.mumbles, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.jrock.forum.LegacyCar.tires, 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.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:457)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.buildDocumentFields(DocumentBuilderIndexedEntity.java:481)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.getDocument(DocumentBuilderIndexedEntity.java:379)
at org.hibernate.search.engine.DocumentBuilderIndexedEntity.createAddWork(DocumentBuilderIndexedEntity.java:317)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.index(EntityConsumerLuceneworkProducer.java:155)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.indexAllQueue(EntityConsumerLuceneworkProducer.java:123)
at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.run(EntityConsumerLuceneworkProducer.java:96)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

Users with the same issue

2 times, 10 months ago
2 times, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 9 months ago

Write tip

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