You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Databind 2.9.9.2 not working with Spring Boot 2.1 - "No converter found for return value of type: class com.fasterxml.jackson.databind.node.ObjectNode
#2412
We have an Spring boot application that just returns an ObjectMapper Object to build some custom JSON responses. It was working up to jackson-databind 2.9.9.1. Only changing jackson-databind to latest version 2.9.9.2 it throws an NullPointerException during serialization
The following three files contain a minimal Spring boot Application running under OpenJDK 11.0.3
It contains the following version, they only differ at jackson-databind version
jackson-core 2.9.9
spring boot 2.1.6.RELEASE
$ curl -i http://localhost:8080/test/
HTTP/1.1 500
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 06 Aug 2019 11:13:57 GMT
Connection: close
{"timestamp":"2019-08-06T11:13:57.253+0000","status":500,"error":"Internal Server Error","message":"No converter found for return value of type: class com.fasterxml.jackson.databind.node.ObjectNode","path":"/test/"}
The spring boot log from the non-working version is
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.RELEASE)
2019-08-06 13:13:50.810 INFO 32432 --- [ main] jackson.Application : Starting Application on schleppi with PID 32432 (/home/user/workspaces/jackson-test/target/classes started by user in /home/user/workspaces/jackson-test)
2019-08-06 13:13:50.819 INFO 32432 --- [ main] jackson.Application : No active profile set, falling back to default profiles: default
2019-08-06 13:13:51.591 INFO 32432 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-08-06 13:13:51.608 INFO 32432 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-08-06 13:13:51.608 INFO 32432 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.21]
2019-08-06 13:13:51.654 INFO 32432 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-08-06 13:13:51.654 INFO 32432 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 802 ms
2019-08-06 13:13:51.783 INFO 32432 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2019-08-06 13:13:51.896 INFO 32432 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2019-08-06 13:13:51.899 INFO 32432 --- [ main] jackson.Application : Started Application in 1.3 seconds (JVM running for 1.707)
2019-08-06 13:13:57.219 INFO 32432 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-08-06 13:13:57.220 INFO 32432 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2019-08-06 13:13:57.224 INFO 32432 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 4 ms
2019-08-06 13:13:57.243 WARN 32432 --- [nio-8080-exec-1] .c.j.MappingJackson2HttpMessageConverter : Failed to evaluate Jackson serialization for type [class com.fasterxml.jackson.databind.node.ObjectNode]: java.lang.NullPointerException
2019-08-06 13:13:57.243 WARN 32432 --- [nio-8080-exec-1] .c.j.MappingJackson2HttpMessageConverter : Failed to evaluate Jackson serialization for type [class com.fasterxml.jackson.databind.node.ObjectNode]: java.lang.NullPointerException
2019-08-06 13:13:57.247 WARN 32432 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class com.fasterxml.jackson.databind.node.ObjectNode]
Thanks,
Stefan Seide
The text was updated successfully, but these errors were encountered:
We have an Spring boot application that just returns an ObjectMapper Object to build some custom JSON responses. It was working up to jackson-databind 2.9.9.1. Only changing jackson-databind to latest version 2.9.9.2 it throws an NullPointerException during serialization
The following three files contain a minimal Spring boot Application running under OpenJDK 11.0.3
It contains the following version, they only differ at jackson-databind version
jackson-core 2.9.9
spring boot 2.1.6.RELEASE
The test project consist of the following three files - please rename uploaded files accordingly
pom.txt
Application.txt
TestController.txt
Tested with curl on command line - working version:
Non-working version with databind 2.9.9.2
The spring boot log from the non-working version is
Thanks,
Stefan Seide
The text was updated successfully, but these errors were encountered: