1

I am getting below exception when I am doing clustering in Tomcat.

SEVERE: Unable to serialize delta request for sessionid [E67521E84EE07AB85E0243149B4DE472.jvm2] java.io.NotSerializableException: org.mybatis.spring.SqlSessionTemplate at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
Hima
  • 11
  • 2

1 Answers1

1

The Javadoc of the exception explains the meaning of the exception:

Thrown when an instance is required to have a Serializable interface. The serialization runtime or the class of the instance can throw this exception. The argument should be the name of the class.

https://docs.oracle.com/javase/7/docs/api/java/io/NotSerializableException.html

Somehow your program tries to write an instance of SqlSessionTemplate to an object stream (aka serialization), perhaps to send it over a network to a different machine.

Normally to fix this exception, you let a class implement the Serializable interface, but since this is a library class and it's not owned by you, it cannot be changed and hence it's not meant to be serialized.

Luciano van der Veekens
  • 6,307
  • 4
  • 26
  • 30