简体   繁体   中英

java.io.NotSerializableException: org.mybatis.spring.SqlSessionTemplate

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM