Today encountered problems such as the title of the work, specially after the record about solving
springboot class will start scanning the current package and the package, and that bean I was not there, so the injection failure, solution is to take the initiative by adding annotations @Bean to spring management
@Configuration
public class AuditConfiguration {
@Bean(name = "printLogHandler")
public PrintLogHandler printLogHandler() {
return new PrintLogHandler();
}
@Bean (name = "rocketMQHandler")
public RocketMQHandler rocketMQHandler() {
return new RocketMQHandler();
}
}