binnding RMIDispatcher to client

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: binding RMIDispatcher to client

David E Jones-2

One trick with this: it is a good temporary fix, but not something I  
think we'll do in the project because it is tough to remember to  
manually change it each time the fields (or the data structure in  
general of the class) change.

-David


On Aug 8, 2006, at 3:36 PM, Brett Palmer wrote:

> FYI,
>
> Another quick fix to the RMI serialization problem is to explicitly
> define the serialization constant, serialVersionUI.  Then it doesn't
> matter if the code was compiled outside of eclipse (i.e. Ant for
> ofbiz) or inside eclipse for your RMI test client.
>
> For example:
>
>  private static final long serialVersionUID = -6978458356505526156L;
>
> This may be impractical to do for every serializable class in ofbiz
> but it does work on a case by case basis.
>
>
>
> Brett

Reply | Threaded
Open this post in threaded view
|

Re: binding RMIDispatcher to client

Wojciech Gdela
Hello,

http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html

"However, it is _strongly_recommended_ that all serializable classes
explicitly declare serialVersionUID values, since the default
serialVersionUID computation is highly sensitive to class details that
may vary depending on compiler implementations, and can thus result in
unexpected InvalidClassExceptions during deserialization."

See also:
http://www.javapractices.com/Topic45.cjp

--
Best regards,
Wojciech Gdela

> One trick with this: it is a good temporary fix, but not something I
> think we'll do in the project because it is tough to remember to
> manually change it each time the fields (or the data structure in
> general of the class) change.
>
> -David
>
>
> On Aug 8, 2006, at 3:36 PM, Brett Palmer wrote:
>
>> FYI,
>>
>> Another quick fix to the RMI serialization problem is to explicitly
>> define the serialization constant, serialVersionUI.  Then it doesn't
>> matter if the code was compiled outside of eclipse (i.e. Ant for
>> ofbiz) or inside eclipse for your RMI test client.
>>
>> For example:
>>
>>  private static final long serialVersionUID = -6978458356505526156L;
>>
>> This may be impractical to do for every serializable class in ofbiz
>> but it does work on a case by case basis.
>>
>>
>>
>> Brett
>
>

12