Closed sachins50 closed 6 years ago
Could you please provide me your Spring version and the selected Chaos Monkey version?
I think you‘re running Spring Boot 2.0.x with Chaos Monkey for Spring Boot 1.5.0...
we are using Spring boot 2.0
Hmmm...I tried it with some demo examples but could not reproduce the error. I will create a demo with cloud foundry.
Just to be clear, you are using the following versions:
Is it ok when you post your pom file?
I tried it with Pivotal Cloud Foundry and it works. I created a gist for you, please take a look and compare it with your setup. Chaos Monkey works like expected and has attacked the HelloController with Latency Assault.
You can find the gist at: https://gist.github.com/MrBW/20b3b8ad88823a4dd3716de947942527
Please let me know if I can help! You are welcome and thanks for sharing!
Hi,
We can enable chaos monkey as well as watcher for @RestController in my sample standalone spring boot project for consuming one getChallange REST Call
i. Since in my sample project, I have used this annotation alone, out of watchers - @Controller,@RestController, @Service, @Repository, @Component
ii. When introduce other watchers (respective java annotations have not used in my application), I am not able run an application and throwing an error as below:
2018-08-08 18:05:06.051 ERROR 17136 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:155) ~[spring-boot-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-5.0.4.RELEASE.jar:5.0.4.RELEASE]
iii. I suspect this issues may be an internal implementation of Spring AOP usage on chaos monkey as mentioned below
iv. We need to check with author to confirm our understanding is correct or any other way can handle this issues
Application.yml configuration for reference
cloud:
config:
uri: http://localhost:8888
application:
name: usuarios mock
profiles:
active: chaos-monkey
chaos:
monkey:
enabled: true
watcher:
restController: true
controller: true
server: port: 8017
Syntax :
chaos:
monkey:
enabled: true
watcher:
# restController: true
# component: true
# service: true
# repository: true
Would need your assistance to proceed using watcher and track or make delay or even killing the application, etc.
Thanks SachinS
Hmm, how could I help? Any chance to take a look at your code for me? Currently it is hard for me to reconstruct your failure. If github is not the right place to share some of your internal code, we can switch to mail or any other private conversation.
Cheers Benjamin
Hi Ben - Please can you share email address ?
benjamin.wilms(at)codecentric.de
I am facing the same, is there a resolution ?
Hi
i'm facing similar problems
Error:
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.stream.config.BindingServiceConfiguration': Unsatisfied dependency expressed through field 'binderFactoryListeners'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'chaosMonkeyRequestScope': Requested bean is currently in creation: Is there an unresolvable circular reference? at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:156) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390) at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203) at -------------------------------------------.Application.main(Application.java:14) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.cloud.stream.config.BindingServiceConfiguration': Unsatisfied dependency expressed through field 'binderFactoryListeners'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'chaosMonkeyRequestScope': Requested bean is currently in creation: Is there an unresolvable circular reference?
Application.yml configuration:
spring: profiles: active: chaos-monkey
management: endpoints: web: base-path: / exposure: include: prometheus, env, health, beans, conditions, bindings, info, chaosmonkey endpoint: chaosmonkey: enabled: true
chaos: monkey: enabled: true watcher: component: false controller: false repository: false rest-controller: true service: true
This Spring Versions are used: springBoot Version: 2.1.7.RELEASE springCloud Version: Greenwich.SR2 springCloudServices Version: 2.1.2.RELEASE
I tried the chaos monkey version Version 2.0.2 Version 2.1.0 Version 2.2.0-SNAPSHOT
and have same behvior maybe some problems with this spring 2.1.7 version we use? do you have experience there?
Thank you for any advice
Hi
i test my application with an older Spring version
springBoot Version: 2.0.3.RELEASE springCloud Version: Finchley.RELEASE springCloudServices Version: 2.0.0.RELEASE
and chaos-monkey-spring-boot:2.0.2
and there was no error. :-)
can you evaluate what could be the problem? I appreciate any help
Could the problem described here be related to this one here: https://github.com/codecentric/chaos-monkey-spring-boot/issues/118 ?
@ingoschaal yes, youre right. Most likely your issue is a duplicate of #118.
You can check out #120 and see if it fixes the problem for you.
@WtfJoke #120 fix my problems thanks
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'electoralController': Unsatisfied dependency expressed through field 'electoral'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'electoralServiceImpl': Unsatisfied dependency expressed through field 'applicationrepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.spring.json.Application
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$141/356303170.getObject(Unknown Source) ~[na:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:882) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.6.RELEASE.jar:2.2.6.RELEASE]
at com.spring.SpringrestfulApplication.main(SpringrestfulApplication.java:11) [classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_20]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_20]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_20]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_20]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.2.6.RELEASE.jar:2.2.6.RELEASE]
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'electoralServiceImpl': Unsatisfied dependency expressed through field 'applicationrepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.spring.json.Application
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$141/356303170.getObject(Unknown Source) ~[na:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1290) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1210) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
... 25 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'applicationRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a managed type: class com.spring.json.Application
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$141/356303170.getObject(Unknown Source) ~[na:na]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1290) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1210) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.5.RELEASE.jar:5.2.5.RELEASE]
... 39 common frames omitted
Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.spring.json.Application
at org.hibernate.metamodel.internal.MetamodelImpl.managedType(MetamodelImpl.java:582) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
at org.hibernate.metamodel.internal.MetamodelImpl.managedType(MetamodelImpl.java:85) ~[hibernate-core-5.4.12.Final.jar:5.4.12.Final]
at org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation.
@Ravigupta-0 please format your stacktrace properly. A guide can be found here: https://guides.github.com/features/mastering-markdown/. Also, please describe your problem and if possible provide us with a minimal example project reproducing the issue you're facing. If you're having general questions about chaos monkey for spring boot, please use stackoverflow and tag it with chaos-monkey-spring-boot.
Any solution to above issue. I am also facing simmilar error and not able to find exact root cause.
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'chaos.monkey.watcher-de.codecentric.spring.boot.chaos.monkey.configuration.WatcherProperties': Unsatisfied dependency expressed through field 'service'; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'boolean'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value []
My spring boot version 2.4.0 and chaos-monkey-spring-boot is 2.2.0.
Can any one please help or guide me here.
@surajpanda1582 can you reproduce the error with a newer chaos monkey spring boot version (like 2.5.4 or 2.4.5)?
If that issue still persists, can you provide a minimal example project which reproduces the issue you're facing. If so, please create a new bug :)
We are trying to use this code in our Spring boot application. We use pivotal cloud foundry to deploy the code. When we have this in the application.yml: spring: profiles: active: chaos-monkey chaos: monkey: enabled: true
And also when we add watcher and try to re-stage or start the application. We are seeing errors:--
ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryConfiguration$EmbeddedTomcat': Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'chaos.monkey-de.codecentric.spring.boot.chaos.monkey.configuration.ChaosMonkeyProperties': Could not bind properties to 'ChaosMonkeyProperties' : prefix=chaos.monkey, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConversionServiceDeducer$Factory': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'componentAspect': Requested bean is currently in creation: Is there an unresolvable circular reference?