com.hazelcast.nio.serialization.HazelcastSerializationException: Failed to serialize 'com.hazelcast.spi.impl.operationservice.impl.operations.Backup'

  1. 0

    Hazelcast, HazelcastSerializationException: Failed to serialize 'com.hazelcast.spi.impl.operationservice.impl.operations.Backup'

    Stack Overflow | 3 months ago | I. Domshchikov
    com.hazelcast.nio.serialization.HazelcastSerializationException: Failed to serialize 'com.hazelcast.spi.impl.operationservice.impl.operations.Backup'
  2. 0

    ConcurrentModificationException in JDBC SessionManger

    Eclipse Bugzilla | 4 years ago | laeubi
    java.util.ConcurrentModificationException: null
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    We cache SimpleSession in EhCache which is configured with Overflow to Disk and an LRU eviction policy. When the cache is full, EhCache will attempt to evict a session from the Disk Storage to reclaim space. To evict the `SimpleSession`, EhCache will attempt to deserialize the eveicted session first. From time to time, the deserialization of the `SimpleSession` fails. When that happens the system is locked, since no additional session can be created. `SimpleSession` has a custom serialization mechanism that calculates a bit mask which indicates which fields of the `SimpleSession` contain values. This bitMask is serialized first (as a Short) then the fields containing values. When deserialization is failing, the bitMask indicates that the `attributes` Map contains data, however no `attributes` have actually been serialized and the deserialization fails with a `java.io.OptionalDataException`. The discrepancy is very likely due to `attributes` being a non synchronized Map: the SimpleSession is created on a Servlet thread, however the serialization to Disk is performed by EhCache on one of its cache management threads. SimpleSession fields should likely be marked as volatile and the Map should be a Synchronized Map or SimpleSession should be made immutable.

    Apache's JIRA Issue Tracker | 3 years ago | Bruno GRIEDER
    net.sf.ehcache.CacheException: Failed to serialize element due to ConcurrentModificationException. This is frequently the result of inappropriately sharing thread unsafe object (eg. ArrayList, HashMap, etc) between threads

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.util.ConcurrentModificationException

      null

      at java.util.ArrayList.writeObject()
    2. Java RT
      ObjectOutputStream.writeObject
      1. java.util.ArrayList.writeObject(Unknown Source)
      2. sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      5. java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
      6. java.io.ObjectOutputStream.writeSerialData(Unknown Source)
      7. java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
      8. java.io.ObjectOutputStream.writeObject0(Unknown Source)
      9. java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
      10. java.io.ObjectOutputStream.writeSerialData(Unknown Source)
      11. java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
      12. java.io.ObjectOutputStream.writeObject0(Unknown Source)
      13. java.io.ObjectOutputStream.writeObject(Unknown Source)
      14. java.util.ArrayList.writeObject(Unknown Source)
      15. sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
      16. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      17. java.lang.reflect.Method.invoke(Unknown Source)
      18. java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
      19. java.io.ObjectOutputStream.writeSerialData(Unknown Source)
      20. java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
      21. java.io.ObjectOutputStream.writeObject0(Unknown Source)
      22. java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
      23. java.io.ObjectOutputStream.writeSerialData(Unknown Source)
      24. java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
      25. java.io.ObjectOutputStream.writeObject0(Unknown Source)
      26. java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
      27. java.io.ObjectOutputStream.writeSerialData(Unknown Source)
      28. java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
      29. java.io.ObjectOutputStream.writeObject0(Unknown Source)
      30. java.io.ObjectOutputStream.writeObject(Unknown Source)
      30 frames
    3. com.hazelcast.internal
      ByteArrayObjectDataOutput.writeObject
      1. com.hazelcast.internal.serialization.impl.JavaDefaultSerializers$JavaSerializer.write(JavaDefaultSerializers.java:242)
      2. com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.write(StreamSerializerAdapter.java:41)
      3. com.hazelcast.internal.serialization.impl.AbstractSerializationService.writeObject(AbstractSerializationService.java:199)
      4. com.hazelcast.internal.serialization.impl.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:371)
      4 frames
    4. com.hazelcast.map
      PartitionWideEntryWithPredicateBackupOperation.writeInternal
      1. com.hazelcast.map.impl.operation.PartitionWideEntryBackupOperation.writeInternal(PartitionWideEntryBackupOperation.java:98)
      2. com.hazelcast.map.impl.operation.PartitionWideEntryWithPredicateBackupOperation.writeInternal(PartitionWideEntryWithPredicateBackupOperation.java:51)
      2 frames
    5. Hazelcast
      Operation.writeData
      1. com.hazelcast.spi.Operation.writeData(Operation.java:472)
      1 frame
    6. com.hazelcast.internal
      ByteArrayObjectDataOutput.writeObject
      1. com.hazelcast.internal.serialization.impl.DataSerializableSerializer.write(DataSerializableSerializer.java:161)
      2. com.hazelcast.internal.serialization.impl.DataSerializableSerializer.write(DataSerializableSerializer.java:52)
      3. com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.write(StreamSerializerAdapter.java:41)
      4. com.hazelcast.internal.serialization.impl.AbstractSerializationService.writeObject(AbstractSerializationService.java:199)
      5. com.hazelcast.internal.serialization.impl.ByteArrayObjectDataOutput.writeObject(ByteArrayObjectDataOutput.java:371)
      5 frames
    7. com.hazelcast.spi
      Backup.writeInternal
      1. com.hazelcast.spi.impl.operationservice.impl.operations.Backup.writeInternal(Backup.java:222)
      1 frame
    8. Hazelcast
      Operation.writeData
      1. com.hazelcast.spi.Operation.writeData(Operation.java:472)
      1 frame
    9. com.hazelcast.internal
      AbstractSerializationService.toBytes
      1. com.hazelcast.internal.serialization.impl.DataSerializableSerializer.write(DataSerializableSerializer.java:161)
      2. com.hazelcast.internal.serialization.impl.DataSerializableSerializer.write(DataSerializableSerializer.java:52)
      3. com.hazelcast.internal.serialization.impl.StreamSerializerAdapter.write(StreamSerializerAdapter.java:41)
      4. com.hazelcast.internal.serialization.impl.AbstractSerializationService.toBytes(AbstractSerializationService.java:140)
      5. com.hazelcast.internal.serialization.impl.AbstractSerializationService.toBytes(AbstractSerializationService.java:124)
      5 frames
    10. com.hazelcast.spi
      OperationThread.run
      1. com.hazelcast.spi.impl.operationservice.impl.OperationServiceImpl.send(OperationServiceImpl.java:406)
      2. com.hazelcast.spi.impl.operationservice.impl.OperationBackupHandler.sendSingleBackup(OperationBackupHandler.java:187)
      3. com.hazelcast.spi.impl.operationservice.impl.OperationBackupHandler.makeBackups(OperationBackupHandler.java:159)
      4. com.hazelcast.spi.impl.operationservice.impl.OperationBackupHandler.backup(OperationBackupHandler.java:78)
      5. com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.sendBackup(OperationRunnerImpl.java:270)
      6. com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.handleResponse(OperationRunnerImpl.java:253)
      7. com.hazelcast.spi.impl.operationservice.impl.OperationRunnerImpl.run(OperationRunnerImpl.java:182)
      8. com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.process(OperationThread.java:122)
      9. com.hazelcast.spi.impl.operationexecutor.impl.OperationThread.run(OperationThread.java:102)
      9 frames