EHC ❯ DiskMarker doesn't have serialVersionUID
-
Bug
-
Status: New
-
2 Major
-
Resolution:
-
ehcache-core
-
-
ljacomet
-
Reporter: cameleec
-
September 23, 2014
-
0
-
Watchers: 2
-
October 01, 2014
-
Attachments
Description
In general DiskMarker doesn’t have serialVersionUID but it’s implements Serializable interface. If you are using diskStore configuration in your ehcache.xml it’s easy to have IncompatibleClassException when you have one machine for testing different java compiled versions. According to Serializable interface Java-doc its “strongly recommended” to have this field.
Comments
Louis Jacomet Jacomet 2014-10-01
Konrad Dobrzynski 2014-10-01
I had Java Hotspot 1.7.0_65 and 1.8.0_20 versions. I was using binary one from Maven Central. If you used 1.8 to compile as Java 7 and then tried to run it on development environment with older java (1.7.0_65) you will recieve IncompatibleClassException when you having your application with disk storage.
Can you provide more details on which JVM combinations you are using that cause this issue? Are you using a binary release of Ehcache or compiling one yourself?
The generated serialVersionUID should be stable for a given binary version according to: http://docs.oracle.com/javase/7/docs/platform/serialization/spec/class.html#4100