-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Application fails to start due to missing AbstractDiscoveryClientOptionalArgs bean #4185
Comments
Please also consider #4177 as my comments there were ignored. |
Same problem with SpringBoot 3.1.1 and SpringCloud 2022.0.3
However i tried this eureka client cloned from here: repository |
Same problem here, also with Spring boot 3.1.1 and Spring Cloud 2022.0.3 |
Same problem here.. any solution |
Same problem |
@HJK181 are you sure that is ok to change @ConditionalOnMissingClass to @ConditionalOnClass |
@Shapoval1van For our purpose as both classes are on the classpath it's enough. However, we only use Eureka for local development ... I doubt that this is a reasonable general-purpose fix ... |
@Shapoval1van The auto-configuration happens inside the spring-cloud-netflix-eureka-client: https://github.com/spring-cloud/spring-cloud-netflix/blob/v4.0.3/spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/config/DiscoveryClientOptionalArgsConfiguration.java#L67 There you can see that the default |
I have nothing more than what I’ve posted in the issue description. What is the exact error you get? My workaround only works if you have JerseyClient and RestTemplate on your classpath. Are you sure the letter is on the classpath as well? |
My bad,I did a rookie mistake. ThanksOn Sep 4, 2023, at 11:44 AM, HJK181 ***@***.***> wrote:
I have nothing more than what I’ve posted in the issue description. What is the exact error you get?
My workaround only works if you have JerseyClient and RestTemplate on your classpath. Are you sure the letter is on the classpath as well?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
We long have assumed that if you have jersey on the classpath then that is what you want to use for eureka since that is the default from Netflix and spring cloud changed our default to RestTemplate. Maybe adding some documentation to https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#eurekaclient-with-jersey Not sure what else to do. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
I don’t know what more feedback I could provide. Everything is described in the ticket, even a necessary workaround. For me the better solution on a clash of the two classes would be to have a property that when set, ignores Jersey on the classpath for every auto configuration checking it class presents. |
Spring 3.2.1 and Spring Cloud 2023.0.0 still have the same problem |
Adding my findings from another bug that I created, missing this one Related: #4177 When jeresey-client lib is present on the class path, in my case via spring-boot-starter-jeresey, application startup will fail with
Auto configuration report for DiscoveryClientOptionalArgsConfiguration
Further analysis To use JereseyClient with eureka, the eureka-client-jeresey3 library must be present on the class path. Suggestion: change conditionals from Eureka Server, which depends on the eureka-client-jeresey3 publishes two beans
So even if eureka-client-jeresey3 and jeresey-client are present, application will still fail to start unless those two beans are also published. Sample https://github.com/ZIRAKrezovic/eureka-reproducer
|
any update, the issue fixed ? |
Same problem |
I'm having the same issue. As I understand, the issue seems to be a lack of a Something along these lines:
|
same error with spring boot works with workaround proposed by @HJK181 |
@spencergibb I'm thinking we could add an opt-in flag ( |
Yeah, that's fine |
After updating Spring-Cloud from 2022.0.2 to 2022.0.3, our application failed to start:
Our application is a mix of spring-boot web application and our internal core that relies on Grizzly and therefore ships
org.glassfish.jersey.client.JerseyClient
as a dependency. Besides the fact that this is a regression, I'm wondering what's the proper way to configure the eureka client if a JerseyClient is on the classpath?As a workaround I created the following configuration class
However, this should work out of the box with auto-configuration as it did before.
The text was updated successfully, but these errors were encountered: