2 Replies Latest reply on Oct 9, 2015 10:30 AM by Paul Ferraro

    Shared sessions cause NotSerializableException on shutdown

    Bob Short Newbie



      we are using wildfly 9 in standalone mode and have enabled shared-sessions in order to propagate the HTTP session across a number of web apps in an EAR. Having done this though it has clearly triggered the activation of some extra facilities usually reserved for when you enable clustering via the <distributable> tag and this is causing some pain.


      The main issue is that whatever reason Wildfly now tries to utilise the session cache which by default has passivation enabled, then on shutdown when the active session gets evicted we see:


      Caused by: org.infinispan.persistence.spi.PersistenceException: org.infinispan.commons.marshall.NotSerializableException: io.undertow.servlet.spec.HttpSessionImpl
              at org.infinispan.marshall.core.MarshalledEntryImpl.marshall(MarshalledEntryImpl.java:107)
              at org.infinispan.marshall.core.MarshalledEntryImpl.getValueBytes(MarshalledEntryImpl.java:88)
              at org.infinispan.persistence.file.SingleFileStore.write(SingleFileStore.java:327)
              ... 20 more
      Caused by: org.infinispan.commons.marshall.NotSerializableException: io.undertow.servlet.spec.HttpSessionImpl
      Caused by: an exception which occurred:
              in field httpSession
              in object java.util.HashMap@8afeaf1c
              in object org.wildfly.clustering.marshalling.SimpleMarshalledValue@8afeaf1c


      This then causes Wildfly to go into a spin on starting it back up again with it spitting out an infinite loop of stackoverflow errors while trying to read the (presumably incomplete) passivated session back in from the cache.


      Have I missed some vital bit of configuration or documentation somwhere?


      Many thanks in advance!