bug:表字段为TEXT,数据返回页面时,打断点查看其为NClobProxyImpl对象
org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/quality].[dispatcherServlet] -Servlet.service() for servlet [dispatcherServlet] in context with path [/quality] threw exception [Request processing failed; nested exception is org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Infinite recursion (StackOverflowError); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError)
解决:数据库连接添加clobAsString=true
url: jdbc:dm://XXX:5236/库名?clobAsString=true
文章讨论了在使用SpringBoot应用处理OracleCLOB类型数据时遇到的StackOverflowError问题,原因是数据转换时的无限递归。解决方案是将数据库连接参数clobAsString设置为true,以避免JSON转换时的递归问题。
1938

被折叠的 条评论
为什么被折叠?



