Skip to Content
author's profile photo Former Member
Former Member

NotSerializableException when using Spring session failover

Hi!

We are using 6.3.0.2 and recently enabled session failover (https://help.hybris.com/6.3.0/hcd/5da5660b2a3f4263ac3095d900d07f88.html).

However, we are now getting NotSerializableExceptions as hybris tries to persist HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper which is not serializable. We have tried both asynchronous and synchronous session persisters but with the same result.

We are not storing the request in the session ourselves, that seems to be done as part of the Spring Security filter chain.

Has anyone else experienced this problem?

Cheers, Anders

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Posted on May 10, 2017 at 08:49 AM

    Hi Anders!

    I just tried the session failover also with hybris 6.3.0.2 B2C accelerator. I did not face any problems.

    Regards, Thomas

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 13, 2017 at 05:56 PM

    Hi, I am also getting same exception with that hybris version. I have followed all the steps as per wiki link. [ERROR] 2017-06-13 11:02:19.383 [(51) AsyncSessionPersister-master-51] [AsyncSessionPersisterRunnable] Async session persister encountered an exception while trying to persist sessions asynchronously! org.apache.commons.lang3.SerializationException: java.io.NotSerializableException: org.springframework.security.web.servletapi.HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper at org.apache.commons.lang3.SerializationUtils.serialize(SerializationUtils.java:156) ~[commons-lang3-3.4.jar:3.4] at org.apache.commons.lang3.SerializationUtils.serialize(SerializationUtils.java:178) ~[commons-lang3-3.4.jar:3.4] at de.hybris.platform.servicelayer.web.session.persister.AbstractSessionPersister.updateModelIfNecessary(AbstractSessionPersister.java:38) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.web.session.persister.AsyncSessionPersisterRunnable.persistSessions(AsyncSessionPersisterRunnable.java:175) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.web.session.persister.AsyncSessionPersisterRunnable.persistsSessionsFromQueue(AsyncSessionPersisterRunnable.java:113) ~[coreserver.jar:?] at de.hybris.platform.servicelayer.web.session.persister.AsyncSessionPersisterRunnable.run(AsyncSessionPersisterRunnable.java:74) [coreserver.jar:?] at de.hybris.platform.core.AbstractTenant$5.run(AbstractTenant.java:2521) [coreserver.jar:?] at de.hybris.platform.core.TenantAwareThreadFactory$1.run(TenantAwareThreadFactory.java:158) [coreserver.jar:?] Caused by: java.io.NotSerializableException: org.springframework.security.web.servletapi.HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 21, 2017 at 03:49 PM

    We found that these configurations are required in cluster environment only NOT for local. We not getting these exceptions in local after removing these.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 25, 2017 at 09:52 PM

    Session failover requires that EVERYTHING in your session is serializable.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Yes, But I don't know why OOTB hybris log error this class java.io.NotSerializableException: org.springframework.security.web.servletapi.HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper is not serialize

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.