Using Feign… errors and success

In the tutorial (Step 21) we need to use Feign. He suggested a pom.xml dependency, but the import didn’t match up.

He was importing:

import org.springframework.cloud.netflix.feign.EnableFeignClients;

and

import org.springframework.cloud.netflix.feign.FeignClient;

But there was nothing in the dependency he advocated. After a bit of searching:

Change:

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>

to:

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-core</artifactId>
<version>1.4.5.RELEASE</version>
</dependency>

But this gave all sorts of weird errors, like:

FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class

and:

JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on checking for an interface [util.c:1313]

After removing all the Feign stuff, it was still not right, so I removed the netflix dependency and it was fine.

After a bit of searching I found that  spring-cloud-starter-feign was deprecated and I had to use spring-cloud-starter-openfeign.

A clean, stop and start, and we’re away again, phew! 

Leave a comment