Skip to content

Conversation

vpavic
Copy link
Contributor

@vpavic vpavic commented May 17, 2019

This resolves #16871 by ensuring auto-configuration of Spring Session's DefaultCookieSerializer doesn't break when Spring Security is not present on the classpath.

The approach taken in this PR uses an anonymous BeanPostProcessor - I'm not sure this is an acceptable approach but introducing some sort of a customizer bean seemed like an overhead in DefaultCookieSerializer case.

Regarding the anonymous BeanPostProcessor pattern, it is also present in LiquibaseEndpointAutoConfiguration.

This commit ensures auto-configuration of Spring Session's DefaultCookieSerializer doesn't break when Spring Security is not present on the classpath.
@philwebb
Copy link
Member

We might get away with getting the bean programmatically rather than needing the BeanPostProcessor. We'll try that when we merge.

@snicoll snicoll changed the title Improve Spring Session auto-configuration Fix NoClassDefFoundError when Spring Session is used without Spring Security May 17, 2019
philwebb added a commit that referenced this pull request May 28, 2019
* pr/16889:
  Polish "Fix NoClassDefFound when missing Spring Security"
  Fix NoClassDefFound when missing Spring Security
@philwebb philwebb closed this in e9bd11e May 28, 2019
@philwebb
Copy link
Member

philwebb commented May 28, 2019

Thanks @vpavic, now fixed with a small change to remove the need for the BPP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: merge-with-amendments Needs some changes when we merge type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring Session without Spring Security leads to NoClassDefFoundError: org/springframework/security/web/authentication/RememberMeServices
3 participants