ошибка создания бина с именем org.springframework.scheduling.annotation.proxyasyncconfiguration ' - PullRequest
1 голос
/ 01 марта 2020

Я получаю ошибку ниже, может кто-нибудь сказать мне, что не так. Я не могу определить.

2020-03-01 22:26:02.946  INFO 15968 --- [           main] h.HappyconnectswebApiApplication         : Starting HappyconnectswebApiApplication on MYDLNG with PID 15968 (D:\happyconnects\happyconnectsweb-api\target\classes started by Ravikumar Kubusada in D:\happyconnects\happyconnectsweb-api)
2020-03-01 22:26:02.981  INFO 15968 --- [           main] h.HappyconnectswebApiApplication         : The following profiles are active: dev
2020-03-01 22:26:06.008  INFO 15968 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-03-01 22:26:06.212  INFO 15968 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 171ms. Found 1 JPA repository interfaces.
2020-03-01 22:26:08.323  INFO 15968 --- [           main] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2020-03-01 22:26:08.532  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
2020-03-01 22:26:08.533  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2020-03-01 22:26:08.533  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
2020-03-01 22:26:08.534  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper
2020-03-01 22:26:08.534  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
2020-03-01 22:26:08.534  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
2020-03-01 22:26:08.534  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application-dev.properties] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2020-03-01 22:26:08.534  INFO 15968 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource applicationConfig: [classpath:/application.properties] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
2020-03-01 22:26:09.285  WARN 15968 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.scheduling.annotation.ProxyAsyncConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'asyncConfiguration' defined in file [D:\happyconnects\happyconnectsweb-api\target\classes\com\happyconnects\web\api\config\AsyncConfiguration.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.happyconnects.web.config.HappyConnectsProperties' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2020-03-01 22:26:09.329  INFO 15968 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-01 22:26:09.996 ERROR 15968 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Описание:

Parameter 0 of constructor in com.happyconnects.web.api.config.AsyncConfiguration required a bean of type 'com.happyconnects.web.config.HappyConnectsProperties' that could not be found.

Действие:

Consider defining a bean of type 'com.happyconnects.web.config.HappyConnectsProperties' in your configuration

Спасибо заранее

1 Ответ

0 голосов
/ 03 марта 2020

После чесания головы в течение 2 часов обнаружил, что @ComponentScan может работать, и это сработало. Используйте @ComponentScan в своем классе конфигурации.

...