org.hibernate.LazyInitializationException

failed to lazily initialize a collection of role: contacts.resources.Category.subcategory, could not initialize proxy - no Session


Samebug tips2

Use the proper ORM annotations (@ManyToOne and @OneToMany).

Use eager fetch (fetch = FetchType.EAGER) annotation.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web718

Solution icon of stackoverflow
failed to lazily initialize a collection of role: contacts.resources.Category.subcategory, could not initialize proxy - no Session

Solution icon of github
via GitHub by gioppoluca
, 1 year ago
failed to lazily initialize a collection of role: eu.cloudopting.domain.Customizations.deployInfos, could not initialize proxy - no Session

Solution icon of github
failed to lazily initialize a collection of role: br.gov.jfrj.siga.dp.DpLotacao.lotacoesPosteriores, could not initialize proxy - no Session

Solution icon of github
failed to lazily initialize a collection of role: com.whiuk.philip.mmorpg.serverShared.Account.loginAttempts, could not initialize proxy - no Session

Solution icon of duraspace
via Sakai JIRA by Terry Brady, 1 year ago
failed to lazily initialize a collection of role: org.dspace.content.DSpaceObject.handles, could not initialize proxy - no Session

Solution icon of stackoverflow
failed to lazily initialize a collection of role: com.br.common.catalog.entity.Category.allParentCategoryXrefs, could not initialize proxy - no Session

Solution icon of stackoverflow
failed to lazily initialize a collection of role: com.horariolivre.entity.Usuario.autorizacoes, could not initialize proxy - no Session

Solution icon of stackoverflow
failed to lazily initialize a collection of role: com.vub.model.Traject.courses, could not initialize proxy - no Session

Solution icon of stackoverflow
failed to lazily initialize a collection of role: edu.ucdavis.dss.dw.entities.Instructor.courses, could not initialize proxy - no Session

Solution icon of stackoverflow
failed to lazily initialize a collection of role: com.wpt.models.Item.itemCategory, could not initialize proxy - no Session

Stack trace

  • org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: contacts.resources.Category.subcategory, could not initialize proxy - no Session at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:575)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 4 weeks ago
5 times, 1 month ago
3 times, 1 month ago
Once, 1 month ago
Once, 2 months ago
40 more bugmates