Skip to content

SerialVersionUID not working (Scala 2.9.3, Mac OSX 10.8.2, Java 1.7.0_09, Eclipse Juno) #6713

Closed
@scabug

Description

@scabug

Code snippet:

@serialversionuid(1000L)
class dsContextBase(status:VersionStatus.Value) extends Serializable
....

@serialversionuid(1001L)
class dsContext(status:VersionStatus.Value) extends dsContextBase(status)
....

The 'dsContext' class is the one actually being serialized/deserialized (sent from a server to a client).

This all works compiling on a Windows XP machine, Scala 2.9.1, Java 1.7.0_07, Eclipse Indigo. In fact, on the client I deliberately modified the SerialVersionUID and forced the expected errors on de-serialization. The error messages included the correct SerialVersionUID values for both the external and local classes.

On the Mac, get the error:

java.io.InvalidClassException: scala.reflect.ClassTypeManifest; local class incompatible: stream classdesc serialVersionUID = -1175914390044276083, local class serialVersionUID = -6957848672150754496

First note that the local serialVersionUID is not as expected. It appears that the annotation was ignored and the default UID was computed.

If I compile on the Windows machine, create a JAR, copy the Jar to the MAC machine, and then execute from that Jar -- it works. So it would appear that Mac OS X and Java 1.7.0_09 are not the culprits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions