自己写业务Controller类添加spring的@Value注解启动报错?

鹏鹏 · 2022-04-20 22:47
现象:Controller类里加spring的@Value注解拿配置文件的某个值,项目打包启动后会报以下错误,一直启动失败; Exception thrown from ApplicationListener handling ContextClosedEvent org.springframework.beans.factory.BeanCreationNotAllowedException:  Error creatingbean with name 'rabbitConnectionFactory':  Singleton bean creation not allowed while singletons of this factory are in destruction  (Do not request a bean from a BeanFactory in a destroy method implementation!) 自己解决处理:Controller移除@Value注解,改加在相应Service层加载配置,就不会报这个错; 自己写的这个代码中也并没有使用到RabbitMQ相关组件呢,请问这是什么原因呢?
0 个回答
暂无回答