Upgrading from 1.8.4 to 1.9.0, I am getting: java.io.InvalidClassException: org.apache.tools.ant.Location; local class incompatible: stream classdesc serialVersionUID = -2242957035428169563, local class serialVersionUID = 1 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:604) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1970) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1894) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1777) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) during deserialization of custom exception classes extending 'org.apache.tools.ant.BuildException'. This is happening due to the addition of private static final long serialVersionUID = 1L; to class org.apache.tools.ant.Location. The serial version UID of that class should be corrected.
The private static final long serialVersionUID = 1L was added between Ant 1.8.4 and Ant 1.9.0 in Revision 1375137 as part of a series of Java 5 updates. It looks like this is a change which has broken some degree of compatibility between Ant 1.8.4 and Ant 1.9.0 but this is a one time change. This change should have been documented in WHATSNEW and ReleaseNotes as a change that could break older environment. I will revert to the dev at ant.apache.org list to see whether we should close this bug report as WONTFIX - my personal inclination.
Quoting Conor MacNeill >Yes, I think WONTFIX is the correct approach. >I don't think we want to give any guarantees about compatibility of >object serializations across Ant versions. I think object >serialization is not really intended for long term object storage, >more just for object transmission. >Do we know why Ant objects are being serialized at all? Closing as WONTFIX.
> but this is a one time change. It is a bug. There is no reason to use 1L as the serial version UID instead of the implicit serial version UID corresponding to this class for years. Seems like someone got rid of some warning about a missing serial version UID without understanding what that warning is about.
Can you bring up this discussion to the Ant developer's list. I would be afraid of hurting people who are using Ant 1.9.0 by removing this serial version uid.
I'm afraid it is too late to go back now after we had four (point-)releases using 1 as serialVersionUid - if we restore compatibility with 1.8.4 we break compatibility with 1.9.[0-3].