java.lang.NoSuchMethodError: org.springframework.util.Assert.noNullElements

nrai :

I upgraded the spring-web module version from 5.1.2.RELEASE to 5.2.4.RELEASE for my Micronaut application deployed on AWS. I had to upgrade to a more stable version (suggested fix by WhiteSource) as the older version jar was considered to be highly vulnerable from a security standpoint by the WhiteSource tool.

The issue is that most of my application's endpoints worked just fine as they were mainly database queries but I noticed that if I make a REST call, the endpoint fails with the following error:

Invocation with requestId [ca31a9a5-35b3-4b52-a955-e304d9021880] failed: org.springframework.util.Assert.noNullElements(java.util.Collection, java.lang.String)java.lang.NoSuchMethodError: org.springframework.util.Assert.noNullElements(java.util.Collection, java.lang.String)
at org.springframework.web.client.HttpMessageConverterExtractor.<init>(HttpMessageConverterExtractor.java:77)
at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.<init>(RestTemplate.java:988)
at org.springframework.web.client.RestTemplate.responseEntityExtractor(RestTemplate.java:819)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:582)
at com.connector.getToken(Connector.java:58)

Downgrading the version is not much of an option as those jars will be rejected/deemed vulnerable by WhiteSource. Is there another workaround/solution for this? Please let me know! Thanks.

Marco Behler :

Make sure to upgrade the spring-core dependency to 5.2.4.RELEASE as well.

Or rather: Make sure that all spring- dependencies have the same version number.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=400457&siteId=1