Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with Eureka Discovery Client #32

Open
cedbesafilm opened this issue Oct 6, 2020 · 4 comments
Open

Incompatible with Eureka Discovery Client #32

cedbesafilm opened this issue Oct 6, 2020 · 4 comments

Comments

@cedbesafilm
Copy link

cedbesafilm commented Oct 6, 2020

I was trying to add Eureka Discovery Client to a project but I get this error at runtime

image

So i try to exclude the dependency but without luck

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  <exclusions>
    <exclusion>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-ribbon</artifactId>
    </exclusion>
    <exclusion>
      <groupId>com.netflix.ribbon</groupId>
      <artifactId>ribbon-eureka</artifactId>
    </exclusion>
    <exclusion>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
    </exclusion>
  </exclusions>
</dependency>

There are some workaround for this or they are simply incompatible?

@Michal-Kucera
Copy link

Michal-Kucera commented Feb 18, 2021

I managed to get that working by excluding javax.ws.rs from Eureka client dependency in build.gradle file:

implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' exclude group: 'javax.ws.rs'

My setup is org.springframework.boot 2.4.2, spring-cloud-dependencies 2020.0.1, embedded keycloak 2.4.0.

You may try a similar approach with Maven.

FYI check out https://gitlab.com/spring-cloud-infrastructure/authorization-server/-/blob/master/build.gradle#L41 for more info.

@cedbesafilm
Copy link
Author

Later in the project i start to use docker version of keycloak :)

@Michal-Kucera
Copy link

Michal-Kucera commented Feb 18, 2021

Yeah, I found that as a suitable solution as well, however, I still feel more comfortable with embedding it, especially when I want to do some custom magic around, such as externalize configuration with Spring Config Server, distributed tracing with Sleuth and Zipkin, or implementing a custom Protocol Mapper, etc..

@cedbesafilm
Copy link
Author

Maybe in the future they would be nice things to try but for the current state of the project the docker container is the ideal solution since we don't have big needs and it also integrates well with the library we use for authentication with Angular at the expense of discovery, admin, tracing, etc ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants