Closed
Description
Describe the bug
I have a need to extends the SessionRepositoryFilter. The created bean is proxied by CGLIB, resulting all its private properties null. Causing NullPointerException
in OncePerRequestFilter#doFilter
String alreadyFilteredAttributeName = this.alreadyFilteredAttributeName;
boolean hasAlreadyFilteredAttribute = request.getAttribute(alreadyFilteredAttributeName) != null;
To Reproduce
Create a bean that extends SessionRepositoryFilter with CGLIB proxying enabled.
@Bean(AbstractHttpSessionApplicationInitializer.DEFAULT_FILTER_NAME)
@Order(SessionRepositoryFilter.DEFAULT_ORDER)
public <S extends Session> MyCustomSessionRepositoryFilter sessionRepositoryFilter(...) {
return new MyCustomSessionRepositoryFilter(...);
}
Expected behavior
The custom session repository filter should work properly without any exceptions (NullPointerException)
Sample
I created a pull request here
#1657