Springboot Environment injection exception

  springboot

error

***************************
APPLICATION FAILED TO START
***************************

Description:

Field environment in com.xxx.Environment required a bean of type 'org.springframework.core.env.Environment' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.core.env.Environment' in your configuration.

fix

The reason is that there is a repetition of bean named environment and spring, which needs to be changed.

doc