Not registered via @EnableConfigurationProperties, | A component required a bean of type ‘xxx‘

Posted 一只楠喃

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Not registered via @EnableConfigurationProperties, | A component required a bean of type ‘xxx‘相关的知识,希望对你有一定的参考价值。

Not registered via @EnableConfigurationProperties, marked as Spring component
当使用@ConfigurationProperties时报这个错误

解决办法:
一、在pom.xml中添加依赖:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
</dependency>

二、在你对应的类中添加@Component注解

这样就没有问题了,如果你没有解决把这个提示改成Warning的话就会在运行时报这个错

Description:
A component required a bean of type ‘com.czxy.changgou4.config.JwtProperties’ that could not be found.
Action:
Consider defining a bean of type ‘com.czxy.changgou4.config.JwtProperties’ in your configuration.

以上是关于Not registered via @EnableConfigurationProperties, | A component required a bean of type ‘xxx‘的主要内容,如果未能解决你的问题,请参考以下文章

Not registered via @EnableConfigurationProperties, | A component required a bean of type ‘xxx‘

Not registered via @EnableConfigurationProperties, | A component required a bean of type ‘xxx‘

Not registered via @EnableConfigurationProperties, | A component required a bean of type ‘xxx‘

Not sending via email

ORA-16032 Can not Start Instance via srvctl but via sqlplus is fine [ID 1062071.1]

Spring Cloud Zuul CircuitBreaker All Routes via TurbineStream Not Turbine-AMQP