[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Modifying classes
Hi,
> This is undoubtedly a very basic question but I can't find the answer so
> please just tell me where to RTFM.
>
> I put together a set of classes to store in Ozone as a test. This worked
> great so I decided to modify the classes to do more (and re-generated the
> proxies). But this causes the server to throw an exception
> java.io.InvalidClassException "class not compatible".
>
> I think I deleted all the old objects and restarted the server, but to no
> avail.
>
> Deleting the data directory and re-running ozoneInst solved the problem, but
> seems a little too violent for general use.
>
> What is the correct way to do this?
It is very important to define a static member for each db class that looks
like that:
public final static long serialVersionUID = 1;
This version id is used by the Java serialization to determine if a stored
object is compatible with the current class description. For more information
about it you should read the Java Manual - section 'serialization'.
Best Regards,
Gerd
--
________________________________________________________________
Gerd Mueller gerd@softwarebuero.de
softwarebuero m&b http://www.softwarebuero.de