Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0 RC3
    • Fix Version/s: 5.0 RC4
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      false

      Issue Links

        Activity

        Hide
        sdeleuze Sébastien Deleuze added a comment -

        With SPR-14528 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.

        Show
        sdeleuze Sébastien Deleuze added a comment - With SPR-14528 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.
        Hide
        tsachev Vladimir Tsanev added a comment -

        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
        

        Show
        tsachev Vladimir Tsanev added a comment - 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
        Hide
        juergen.hoeller Juergen Hoeller added a comment -

        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.

        Show
        juergen.hoeller Juergen Hoeller added a comment - 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.
        Hide
        snicoll Stéphane Nicoll added a comment -

        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...)
        

        Show
        snicoll Stéphane Nicoll added a comment - 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...)
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        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.

        Show
        arjen.poutsma Arjen Poutsma added a comment - 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.

          People

          • Assignee:
            snicoll Stéphane Nicoll
            Reporter:
            juergen.hoeller Juergen Hoeller
            Last updater:
            Stéphane Nicoll
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              16 weeks, 2 days ago