On Wed, Oct 2, 2019 at 2:59 PM David Guiney <[email protected]> wrote: > > I upgraded jackson-databind lib to 2.10.0.pr3 to overcome some Veracode > vulnerabilities and now one of my tests is failing on calling > RestTemplate.exchange() on a bad api. > > The RequestEntity has a url of http://localhost:9999/fake/api and HttpMethod > = POST. I have a custom dto for a response type. > > > getRestTemplate().exchange(requestEntity, MyResponseDto.class); > > > My test initially expected a ResourceAccessException, and this worked ok up > to 2.9.10. > > > After upgrade, when I debug into the library code into > org.springframework.web.client.RestTemplate.doExecute() the call on line 733, > requestCallback.doWithRequest(request) throws a NoClassDefFoundError and I > cannot find any implementation of that method. > > > Is there some new setup required? Do I need to implement the RequestCallback > in my code and write a concrete implementation of doExecute? I tried this > with a simple logging, but it did not break there, and I think that would be > a regression of the library if I needed to do this.
None of this code is in Jackson yet, so you'd have to find name of class that was not found. But typically problems like this are due version incompatibility, and most commonly it is an older version of a dependency. For example: `jackson-databind` version 2.9.10 would expect methods from 2.9.x of `jackson-core` (streaming API), so having `jackson-core` 2.7.9 in classpath would very likely produce a `ClassDefNotFoundError` when class it was compiled against was missing from runtime environment. Reverse is not the case, so having newer version of `jackson-core` would usually not be a problem wrt `jackson-databind`. But the easiest way to avoid problems is to enforce same minor version (and while doing that, just sync up to same patch) for all Jackson components. -+ Tatu +- -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/CAL4a10gGHDEKAeVv4bgeYt%2BzY-hw6Pq1g%3D63gmQ0%2BhiE0bqpCA%40mail.gmail.com.
