cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Freeman Fang <>
Subject [DISCUSS]make useFQCNForFaultSerialVersionUID as default behavior for generated exception class
Date Thu, 02 Jun 2011 01:18:43 GMT

Currently when use wsdl2java, by default the generated exception class  
has  a serialVersionUID field which use the timestamp when generate  
the code, also we have another flag useFQCNForFaultSerialVersionUID  
which generate serialVersionUID  based on hashcode of the fully  
qualified class name of the Exception.

The serialVersionUID generally doesn't matter when we use typical way  
to do webservice invocation which use jaxb to do marshall/unmarsall,  
however, for some scenario customer need use java serialization to  
serialize/deserialize the auto-generated Exception object(like using  
jms or rmi to pass object directly), and generally they won't generate  
the code once and use the same copy of generated code everywhere,  
customer just have same copy of wsdl file and generate the code when  
they need use it, this cause the problem that the serialVersionUID is  
different timestamp, so even though it's actually same exception  
class, they can't use java serialization.

I know that customer may change the wsdl before generate code each  
time, but IMHO java serialVersionUID to provide a chance that try it  
best to match the serialize/deserialize even between different java  
class version(a new filed added doesn't matter), so how about we make  
useFQCNForFaultSerialVersionUID as default behavior, if the qualified  
class name not change, then generate same serialVersionUID, it's make  
it easier to use generated exception with java serialization.

Best Regards
Freeman Fang

Twitter: freemanfang
Connect at CamelOne May 24-26
The Open Source Integration Conference

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message