spring.main.allow-circular-references = true to remove the dependency cycle between beanspublic class MyClass {
private DogsController controller;
@Autowired // Constructor-based
public MyClass(DogsController controller) {
this.controller = controller;
public class MyClass {
private DogsController controller;
@Autowired // Setter-based
public void setController(DogsController controller) {
this.controller = controller;
}
public class MyClass {
@Autowired // Filed-based
private DogsController controller;
//application.properties
logging.level.org.springframework=info
spring.profiles.active=dev
//application-dev.properties
logging.level.org.springframework=debug
spring.profiles.active in application.properties config file is set to dev and its higher env if the spring.profiles.active is set to idev then that properties will take priority since idev is higher env than dev.