Spring Troubleshooting Tips
December 30, 2020
Useful Log Points
logging:
level:
org.springframework.web: DEBUG
org.springframework.security: DEBUG
org.springframework.security.oauth2: DEBUG
org.springframework.boot.autoconfigure: DEBUG
# For debugging SpringBootTests:
org.springframework.test.context.web: DEBUGjavax.servlet Filters
org.springframework.security.web.debug.DebugFilterorg.springframework.web.filter.CommonsRequestLoggingFilterch.qos.logback.classic.helpers.MDCInsertingServletFilter
Circular Bean Dependency
Example of What Can Trigger This
A @SpringBootTest with @AutoConfigureMockMvc and a static inner @TestConfiguration class.
The test configuration has a @Bean like a customized RestTemplate which takes @MockMvc as
a parameter.
How To Detect It
Enable trace logging for the DefaultListableBeanFactory:
logging:
level:
org.springframework.beans.factory.support.DefaultListableBeanFactory: TRACE