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

No bean named 'configServerRetryInterceptor' available #879

Closed
sgornostal opened this issue Dec 30, 2017 · 8 comments
Closed

No bean named 'configServerRetryInterceptor' available #879

sgornostal opened this issue Dec 30, 2017 · 8 comments
Labels
Milestone

Comments

@sgornostal
Copy link

Adding config client retry cause application to fail with exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'configServerRetryInterceptor' available

Full stacktrace:

2017-12-30 22:37:06.180 ERROR 8108 --- [           main] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'configServerRetryInterceptor' available
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1205) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.getDelegate(AnnotationAwareRetryOperationsInterceptor.java:175) ~[spring-retry-1.2.1.RELEASE.jar:na]
	at org.springframework.retry.annotation.AnnotationAwareRetryOperationsInterceptor.invoke(AnnotationAwareRetryOperationsInterceptor.java:150) ~[spring-retry-1.2.1.RELEASE.jar:na]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.cloud.config.client.ConfigServerInstanceProvider$$EnhancerBySpringCGLIB$$bf632973.getConfigServerInstance(<generated>) ~[spring-cloud-config-client-2.0.0.M5.jar:2.0.0.M5]
	at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.refresh(DiscoveryClientConfigServiceBootstrapConfiguration.java:80) ~[spring-cloud-config-client-2.0.0.M5.jar:2.0.0.M5]
	at org.springframework.cloud.config.client.DiscoveryClientConfigServiceBootstrapConfiguration.startup(DiscoveryClientConfigServiceBootstrapConfiguration.java:66) ~[spring-cloud-config-client-2.0.0.M5.jar:2.0.0.M5]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:264) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:182) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:144) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:353) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:887) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:751) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:387) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:136) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:193) ~[spring-cloud-context-2.0.0.M5.jar:2.0.0.M5]
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:104) ~[spring-cloud-context-2.0.0.M5.jar:2.0.0.M5]
	at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:70) ~[spring-cloud-context-2.0.0.M5.jar:2.0.0.M5]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
	at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:73) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:350) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:317) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233) [spring-boot-2.0.0.M7.jar:2.0.0.M7]
	at com.example.demoservice.DemoServiceApplication.main(DemoServiceApplication.java:16) [classes/:na]

Process finished with exit code 1

Gradle configuration

dependencies {
	compile('org.springframework.boot:spring-boot-starter-actuator')
	compile('org.springframework.cloud:spring-cloud-starter-config')
	compile('org.springframework.cloud:spring-cloud-starter-consul-discovery')
	compile('org.springframework.boot:spring-boot-starter-webflux')
	compile('org.springframework.boot:spring-boot-starter-aop')
	compile('org.springframework.retry:spring-retry')
	testCompile('org.springframework.boot:spring-boot-starter-test')
	testCompile('io.projectreactor:reactor-test')
}

Spring Cloud version: Finchley.M5
Spring Boot version: 2.0.0.M7

bootstrap.properties

spring.application.name=demo-service
spring.cloud.consul.discovery.health-check-path=/actuator/health
spring.cloud.config.fail-fast=true
spring.cloud.config.discovery.service-id=config-service
spring.cloud.config.discovery.enabled=true

Adding 'RetryOperationsInterceptor' bean with id 'configServerRetryInterceptor' doesn't help.
Changing 'spring.cloud.config.fail-fast' to 'false' doesn't help either.

@spencergibb
Copy link
Member

Did you include spring retry as a dependency?

@sgornostal
Copy link
Author

@spencergibb Yes, I am. I've provided you my dependencies.

@sgornostal
Copy link
Author

Update
Found out the problem. Changing
spring.cloud.config.fail-fast=true
to
spring.cloud.config.failFast=true
did the trick.

@shakuzen
Copy link
Contributor

shakuzen commented Jan 4, 2018

Found out the problem. Changing
spring.cloud.config.fail-fast=true
to
spring.cloud.config.failFast=true
did the trick.

Doesn't this demonstrate that relaxed binding isn't working for that property? I see no reason why it shouldn't.

@spencergibb
Copy link
Member

@shakuzen relaxed binding is handled by boot at this point. If @sgornostal can provide a project that recreates the problem, we'll look further.

@sgornostal
Copy link
Author

@spencergibb
Copy link
Member

Fixed via 6710237

@spencergibb spencergibb added this to the 2.0.0.M6 milestone Jan 17, 2018
@spencergibb
Copy link
Member

See also a4717ee

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

No branches or pull requests

4 participants