0

I've been playing around with the concept outlined in this answer, to share a common 'contract' between server and client. I'm trying to use this concept in a Spring MVC application that contains both REST endpoints and a Feign client. The @RequestMappings on the REST endpoints are picked up like normal by Spring, but: it also picks up the @RequestMapping on the abstract API class I use for my Feign client, i.e., in terms of the linked example, I have a UserService and UserClient in my code, and Spring picks up the @RequestMapping in the UserService class.

I don't understand why this happens in the first place, because:

  • The UserService class is an interface. Why and how does Spring think it can map an endpoint to an interface method?? This will obviously never work.
  • The package containing UserService is not included in the basePackage list of the @ComponentScan annotation on my Application class

Any clues on how I can convince Spring to just ignore all classes in this package??

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
Michel
  • 603
  • 6
  • 15

1 Answers1

1

So apparently this is a known issue, see this thread for ways to fix it.

Michel
  • 603
  • 6
  • 15