[Solved] BeanCreationNotAllowedException:Error creating bean with name ‘rabbitConnectionFactory‘:

BeanCreationNotAllowedException:Error creating bean with name ‘rabbitConnectionFactory‘:

BeanCreationNotAllowedException: Error creating bean 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!)

My reason is: my timer class UnlockOverNumCrontab and DemoServiceImpl class at the same time @Autowired active injection of private IDemoService.
Solution: Add @Lazy annotation to the method name of the UnlockOverNumCrontab class, the default annotation is true

Read More: