Razor Spirit
Razor Spirit

Reputation: 23

Spring Error in restful webservice

I am working with an old release of Spring 3.0.7.RELEASE and I am encountering the error below. Moving to Spring 3.1.1.RELEASE fixes the issue. BUT I cannot move to the new version at this time. What can I do?

Why would spring even attempt to invoke the method anyway?

Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.util.CollectionUtils.unmodifiableMultiValueMap(Lorg/springframework/util/MultiValueMap;)Lorg/springframework/util/MultiValueMap;
    at org.springframework.web.util.HierarchicalUriComponents.<init>(HierarchicalUriComponents.java:81)
    at org.springframework.web.util.UriComponentsBuilder.build(UriComponentsBuilder.java:280)
    at org.springframework.web.util.UriComponentsBuilder.build(UriComponentsBuilder.java:264)
    at org.springframework.web.util.UriTemplate.<init>(UriTemplate.java:70)
    at org.springframework.web.client.RestTemplate$HttpUrlTemplate.<init>(RestTemplate.java:653)
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:407)
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:385)
    at com.capitalone.cam.core.service.impl.AuthenticatorLevelsServiceImpl.retrieve(AuthenticatorLevelsServiceImpl.java:69)
    at com.capitalone.cam.core.service.impl.AuthenticatorLevelsServiceImpl.get(AuthenticatorLevelsServiceImpl.java:48)
    at com.capitalone.cam.core.dao.impl.AuthenticatorLevelsDAOImpl.loadAuthenticatorLevels(AuthenticatorLevelsDAOImpl.java:26)
    at com.capitalone.cam.core.dao.impl.AuthenticatorLevelsDAOImpl.get(AuthenticatorLevelsDAOImpl.java:22)
    at com.capitalone.cam.managers.impl.AuthenticationLevelManagerImpl.initialize(AuthenticationLevelManagerImpl.java:51)
    at com.capitalone.cam.core.client.CapabilitiesManagerAbstract.loadManagers(CapabilitiesManagerAbstract.java:96)
    at com.capitalone.cam.core.client.CapabilitiesManagerAbstract.initialize(CapabilitiesManagerAbstract.java:56)
    at com.capitalone.cam.client.sassy.main.CamTester.main(CamTester.java:178)

Upvotes: 1

Views: 1473

Answers (1)

LppEdd
LppEdd

Reputation: 21172

Looking at the documentation for the 3.0.7 (Link) and for the 3.1.1 (Link) you'll notice there is no method unmodifiableMultiValueMap for 3.0.7.

My guess is you're using Spring components (.jar) with a different version number.

Specifically the HierarchicalUriComponents class (Link) is officially available since 3.1.3

Upvotes: 4

Related Questions