lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: serialVersionUID issue between 2.3 and 2.4
Date Tue, 02 Dec 2008 01:43:46 GMT

Well.. if you don't set serialVersionUID yourself, then java assigns a
rather volatile one for you so that it doesn't attempt to deserialize
to an incompatible local class.

We could assign one ourselves, and then we have to remember to change
it if we ever make a big enough change to Term, to allow serialize in
one version of Lucene & deserialize in another.

Mike

Jason Rutherglen wrote:

> Seeing the following issue between Lucene 2.3 and 2.4. A 2.3  
> serialized Term
> object cannot be deserialized by 2.4.  I would guess it has  
> something to do
> with a different Java compiler being used for the Lucene 2.4 build as
> serialVersionUID is not defined in the Term class.  Fixing the issue  
> is
> critical for a release before the holidays.
>
> The stacktrace below details the error.
>
> Exception in thread "main" java.io.InvalidClassException:
> org.apache.lucene.index.Term; local class incompatible: stream  
> classdesc
> serialVersionUID = 554776219862331599, local class serialVersionUID =
> 435090971444481257
>
>        at
> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
>        at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java: 
> 1552)
>        at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 
> 1699)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
>        at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java: 
> 1908)
>        at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 
> 1719)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
>        at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java: 
> 1908)
>        at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 
> 1719)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
>        at  
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
>        at java.util.ArrayList.readObject(ArrayList.java:591)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun 
> .reflect 
> .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
>        at
> sun 
> .reflect 
> .DelegatingMethodAccessorImpl 
> .invoke(DelegatingMethodAccessorImpl.java:25)
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
>        at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 
> 1719)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
>        at
> java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java: 
> 1908)
>        at
> java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
>        at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java: 
> 1719)
>        at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
>        at  
> java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message