Our project has a requirement to use Jetty instead of Tomcat, and I’m struggling to make the change.
Our application is based off the Bakery starter app.
The console output appears normal when I start the application via spring-boot:run. However, when I load the application in my browser, I see the following exceptions over and over:
org.eclipse.jetty.server.session.UnwriteableSessionDataException: Unwriteable session
…
Caused by: java.io.NotSerializableException: package_name.AuthenticationService (where AuthenticationService is one of my Spring Security-related classes).
If anyone has run into this issue before, I’d really appreciate a hint.
To follow-up on this, I tried implementing Serializable on my AuthenticationService.
Now, jetty complains that my SecurityConfiguration (which extends WebSecurityConfigurerAdapter) is not serializable. Implementing Serializable here yields the following: