-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Labels
Description
I use problem-spring-web-starter:0.25.2
and want to run @SpringBootTest
with spring.main.web-application-type=none
.
The application context can't be initialized as the SecurityProblemSupport
depends on some beans only created for web contexts. All configurations depending on those beans, should be guarded with @ConditionalOnWebApplication
so that they won't be loaded.
Error Output:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of constructor in org.zalando.problem.spring.web.advice.security.SecurityProblemSupport required a bean of type 'org.springframework.web.servlet.HandlerExceptionResolver' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Qualifier(value="handlerExceptionResolver")
The following candidates were found but could not be injected:
- Bean method 'errorAttributes' in 'ErrorMvcAutoConfiguration' not loaded because not a servlet web application
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.web.servlet.HandlerExceptionResolver' in your configuration.