org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.beans.Devices.rules, no session or session was closed

Stack Overflow | user1058913 | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Spring Hibernate not to fetch the child data always

    Stack Overflow | 8 months ago | user1058913
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.beans.Devices.rules, no session or session was closed
  2. 0

    org.hibernate.LazyInitializationException associated collection

    Stack Overflow | 4 years ago | user2054833
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.kyrogaming.models.Users.matchs, could not initialize proxy - no Session
  3. 0

    I need advice on using @JsonIgnore

    Stack Overflow | 2 years ago | Jannis Alexakis
    org.jboss.resteasy.spi.UnhandledException: Response is committed, can't handle exception
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Is there a way to tell DWR to ignore a lazily-initialized field?

    Stack Overflow | 4 years ago | Dave
    org.directwebremoting.ConversionException: Error marshalling data. See the logs for more details.
  6. 0

    Task's threads lunched by Spring Scheduler

    Stack Overflow | 2 years ago | Jp_uy
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.soft1.pack1.data.entity.InitialAlignment.initialAlignment, could not initialize proxy - no Session

  1. linxiaolong 11 times, last 1 week ago
  2. serious2monkeys 10 times, last 5 months ago
  3. MoYapro 3 times, last 5 months ago
  4. tfr 1 times, last 9 months ago
  5. treanz 4 times, last 9 months ago
1 more registered users
5 unregistered visitors
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. org.hibernate.LazyInitializationException

    failed to lazily initialize a collection of role: com.beans.Devices.rules, no session or session was closed

    at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException()
  2. Hibernate
    PersistentBag.iterator
    1. org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:393)
    2. org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:385)
    3. org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:378)
    4. org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:112)
    5. org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:266)
    5 frames
  3. Gson
    Gson.toJson
    1. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:95)
    2. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:60)
    3. com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    4. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:99)
    5. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:219)
    6. com.google.gson.internal.bind.ObjectTypeAdapter.write(ObjectTypeAdapter.java:107)
    7. com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    8. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:96)
    9. com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:60)
    10. com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    11. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:99)
    12. com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:219)
    13. com.google.gson.Gson.toJson(Gson.java:600)
    14. com.google.gson.Gson.toJson(Gson.java:579)
    14 frames
  4. Spring
    AbstractGenericHttpMessageConverter.write
    1. org.springframework.http.converter.json.GsonHttpMessageConverter.writeInternal(GsonHttpMessageConverter.java:199)
    2. org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:100)
    2 frames
  5. Spring MVC
    RequestResponseBodyMethodProcessor.handleReturnValue
    1. org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:222)
    2. org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:153)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:165)
    3 frames
  6. Spring
    HandlerMethodReturnValueHandlerComposite.handleReturnValue
    1. org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:80)
    1 frame
  7. Spring MVC
    FrameworkServlet.doGet
    1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:126)
    2. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
    4. org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    5. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    6. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    7. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    8. org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    8 frames
  8. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    1 frame
  9. Spring MVC
    FrameworkServlet.service
    1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    1 frame
  10. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    1 frame
  11. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    2 frames
  12. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    1 frame
  13. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
    10 frames
  14. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
    3 frames
  15. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    3. java.lang.Thread.run(Thread.java:745)
    3 frames