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
Currently jackson 2.8 support is broken. Is this expected? is spring 5 going to work with jackson 2.9+ only?
Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException
at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:67)
at demo.Demo.main(Demo.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
We're currently indeed requiring Jackson 2.9 in several places. It'll be mandatory in WebFlux for sure, and it also has technical benefits in other converters, so we're likely to decide on a hard Jackson 2.9+ requirement for GA. We need the Jackson 2.9 roadmap to work out first though, with a 2.9 GA release and ideally a 2.9.1 (as a sign of active maintenance) already by the time that we go live in September.
The upgrade to 2.9 broke three tests, the common reason is this new StaxUtil#throwAsParseException that will generate a JsonParseException. Our mapper handles that and throws a HttpMessageNotReadableException while it was previously throwing an IOException.
I am not sure if we can safely adapt those tests and just include the new exception type as part of the migration.
MappingJackson2XmlHttpMessageConverterTests readInvalidXml History
java.lang.Exception: java.lang.Exception: Unexpected exception, expected<java.io.IOException> but was<org.springframework.http.converter.HttpMessageNotReadableException>
java.lang.Exception: Unexpected exception, expected<java.io.IOException> but was<org.springframework.http.converter.HttpMessageNotReadableException>
at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28)
at org.junit.rules.ExpectedException$ExpectedExceptionStatement.evaluate(ExpectedException.java:239)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
(66 more lines...)
Failed MappingJackson2XmlHttpMessageConverterTests readWithExternalReference History
java.lang.AssertionError: java.lang.AssertionError:
Expected: an instance of java.io.IOException
but: <org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Undeclared general entity "ext"
at [row,col {unknown-source}]: [2,186]; nested exception is com.fasterxml.jackson.core.JsonParseException: Undeclared general entity "ext"
at [row,col {unknown-source}]: [2,186]
at [Source: (ByteArrayInputStream); line: 2, column: 187]> is a org.springframework.http.converter.HttpMessageNotReadableException
Stacktrace was: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Undeclared general entity "ext"
at [row,col {unknown-source}]: [2,186]; nested exception is com.fasterxml.jackson.core.JsonParseException: Undeclared general entity "ext"
(206 more lines...)
Failed MappingJackson2XmlHttpMessageConverterTests readWithXmlBomb History
java.lang.AssertionError: java.lang.AssertionError:
Expected: an instance of java.io.IOException
but: <org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Undeclared general entity "lol9"
at [row,col {unknown-source}]: [15,14]; nested exception is com.fasterxml.jackson.core.JsonParseException: Undeclared general entity "lol9"
at [row,col {unknown-source}]: [15,14]
at [Source: (ByteArrayInputStream); line: 15, column: 15]> is a org.springframework.http.converter.HttpMessageNotReadableException
Stacktrace was: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Undeclared general entity "lol9"
at [row,col {unknown-source}]: [15,14]; nested exception is com.fasterxml.jackson.core.JsonParseException: Undeclared general entity "lol9"
(204 more lines...)
I think we can safely change those expected exceptions to the new types. The point is that an exception is thrown for these scenarios; it does not really matter which kind.
Activity
spring-projects-issues commentedon Jun 28, 2017
Sébastien Deleuze commented
With #19097 resolution by Arjen, I think we are just waiting Jackson 2.9.0 GA to be available in order to be able to resolve this issue.
spring-projects-issues commentedon Jul 26, 2017
Vladimir Tsanev commented
Currently jackson 2.8 support is broken. Is this expected? is spring 5 going to work with jackson 2.9+ only?
spring-projects-issues commentedon Jul 26, 2017
Juergen Hoeller commented
We're currently indeed requiring Jackson 2.9 in several places. It'll be mandatory in WebFlux for sure, and it also has technical benefits in other converters, so we're likely to decide on a hard Jackson 2.9+ requirement for GA. We need the Jackson 2.9 roadmap to work out first though, with a 2.9 GA release and ideally a 2.9.1 (as a sign of active maintenance) already by the time that we go live in September.
spring-projects-issues commentedon Jul 31, 2017
Stéphane Nicoll commented
The upgrade to 2.9 broke three tests, the common reason is this new
StaxUtil#throwAsParseExceptionthat will generate aJsonParseException. Our mapper handles that and throws aHttpMessageNotReadableExceptionwhile it was previously throwing anIOException.I am not sure if we can safely adapt those tests and just include the new exception type as part of the migration.
spring-projects-issues commentedon Jul 31, 2017
Arjen Poutsma commented
I think we can safely change those expected exceptions to the new types. The point is that an exception is thrown for these scenarios; it does not really matter which kind.