問題:

springbppt有兩個模塊,mail和server,啟動mail的時候報錯:
1 Description: 2 3 The bean 'queue', defined in com.hyf.MailAppAplication, could not be registered. A bean with that name has already been defined in class path resource [com/hyf/server/conf/RabbitMQConfig.class] and overriding is disabled. 4 5 Action: 6 7 Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
可以看到是因為server模塊里面已經注冊了一個queue的bean了,所以mail里面再注冊會提示已存在。
解決:
根據提示,在mail的配置文件里面加入 spring.main.allow-bean-definition-overriding=true 這個配置就行了。

