【发布时间】:2020-10-08 11:46:17
【问题描述】:
我正在使用 spring boot 2.2.6,正如documentation 所说:
当使用配置属性扫描或通过@EnableConfigurationProperties 注册@ConfigurationProperties bean 时,该bean 有一个常规名称:-,其中是@ConfigurationProperties 注释中指定的环境键前缀,并且是bean 的完全限定名称。如果注解不提供任何前缀,则仅使用 bean 的完全限定名称。
上面示例中的 bean 名称是 acme-com.example.AcmeProperties。
但是,当我使用这个 SpEL 时:@Scheduled(fixedDelayString = "#{@(mr-my.config.properties.ApplicationProperties).task.get(T(my.config.Constants).CONST).delay}") 我得到一个错误:
Parameter 0 of constructor in my.controllers.Controller required a bean named 'mr' that could not be found.
Action:
Consider defining a bean named 'mr' in your configuration.
【问题讨论】:
标签: java spring spring-boot