Exception starting filter [CustomFilter]
See original GitHub issueIssue Description
Expected Behavior
Application should start
Current Behavior
Application does not start.
Instead the application fails to start and results in the exception
java.lang.NullPointerException: null
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:106)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4530)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5169)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
The affected line of code is in the class org.springframework.web.filter.GenericFilterBean. The application can not initialize the logger variable and therefore results in a NullPointerException.
Possible Solution
Unknown to me
Steps to Reproduce
Not needed. Just start the application with the chaos-monkey profile. When omitted the application will start normally.
Context (Environment)
- A custom filter that extends the org.springframework.web.filter.GenericFilterBean
- Spring Boot 2.1.7
- JDK Amazon Corretto 11.04
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
SEVERE: Exception starting filter springSecurityFilterChain
The problem was an incompatibility between my version of Spring and the JDK. I used Spring 3.2 and JDK 1.8. When I changed...
Read more >Custom Filter in the Spring Security Filter Chain - Baeldung
A quick guide to show steps to add custom filter in Spring Security ... We'll start by implementing the org.springframework.web.filter.
Read more >Bugsnag docs › Product › Custom filters
Use custom filters to prioritize application errors. Filter errors by custom metrics, like pricing tier, A/B test variant, or anything else you choose....
Read more >Custom filter fields - Analytics Help
Custom filter fields. The following tables list each available field and its purpose. Content ...
Read more >Custom Filter in Spring Security | Java Development Journal
In this article, we will look at adding a custom filter in Spring Security ... FilterChain filterChain) throws IOException, ServletException ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey guys. I will try to reproduce the behavior with a small code example and reach out to you guys. Sorry for the delay.
hi,
i was facing this issue with custom-filters in my spring-boot app. The application fails to run with chaos-monkey profile active, when we have declared the CustomFilter with @component annotation. The simple workaround is to create the filter with @Bean annotations.
Here is the example code, how i did it. https://github.com/dkdew/spring-boot-chaos-monkey-starting-filter