Skip to content

Exception with JSON serialization in ResponseBodyAdviceChain when debug logging is on [SPR-12616] #17217

@spring-projects-issues

Description

@spring-projects-issues

Grigory Kislin opened SPR-12616 and commented

During serialization bean with lazy initialization hibernate collection I use https://github.com/FasterXML/jackson-datatype-hibernate (Hibernate4Module).

It works OK, but when I set debug logging level I have org.hibernate.LazyInitializationException' exception. Cannot evaluate ...
at line:

org/springframework/spring-webmvc/4.1.4.RELEASE/spring-webmvc-4.1.4.RELEASE
org/springframework/web/servlet/mvc/method/annotation/ResponseBodyAdviceChain.java:61

logger.debug("Invoking ResponseBodyAdvice chain for body=" + body);

Here it trying to make toString entity with lazy initialization.
As workaround I set in logging settings:
<logger name="org.springframework.web.servlet.mvc.method" level="INFO"/>


Affects: 4.1.4

Referenced from: commits f949b2d, cdaf449

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions