com.fasterxml.jackson.databind.JsonMappingException: failed to lazily initialize a collection of role: com.xxxx.xxxx.core.model.catalog.ProductModel.name, could not initialize proxy - no Session

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

Samebug tips

,
Expert tip

Make sure that the property in the beans don't reference its beans.

Solutions on the web

via Spring JIRA by Petar Tahchiev, 1 year ago
failed to lazily initialize a collection of role: com.xxxx.xxxx.core.model.catalog.ProductModel.name, could not initialize proxy - no Session
via Spring JIRA by Petar Tahchiev, 1 year ago
failed to lazily initialize a collection of role: com.xxxx.xxxx.core.model.catalog.ProductModel.name, could not initialize proxy - no Session
via Google Groups by Zhao Weinan, 2 years ago
via Google Groups by Benson Margulies, 5 months ago
com.basistech.rosette.dm.LanguageCodeSerializer cannot be cast to com.fasterxml.jackson.databind.ser.std.StdSerializer
via GitHub by masterspambot
, 1 year ago
[no message for java.lang.NullPointerException]
via GitHub by benson-basis
, 2 years ago
org.fasterxml.tc.TestEnumSerializer cannot be cast to com.fasterxml.jackson.databind.ser.std.StdSerializer
com.fasterxml.jackson.databind.JsonMappingException: failed to lazily initialize a collection of role: com.xxxx.xxxx.core.model.catalog.ProductModel.name, could not initialize proxy - no Session
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:131)
at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:258)
at org.springframework.data.rest.repository.json.PersistentEntityJackson2Module$ResourceSerializer$1.doWithPersistentProperty(PersistentEntityJackson2Module.java:323)
at org.springframework.data.rest.repository.json.PersistentEntityJackson2Module$ResourceSerializer.serialize(PersistentEntityJackson2Module.java:298)
at org.springframework.data.rest.repository.json.PersistentEntityJackson2Module$ResourceSerializer.serialize(PersistentEntityJackson2Module.java:262)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:120)
at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.writeInternal(MappingJackson2HttpMessageConverter.java:194)
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:148)
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:90)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:122)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:368)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at java.lang.Thread.run(Thread.java:722)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
5 more bugmates

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