You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by bu...@apache.org on 2003/05/19 13:14:16 UTC

DO NOT REPLY [Bug 20032] New: - InvalidClassException and AxisFault

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20032>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20032

InvalidClassException and AxisFault

           Summary: InvalidClassException and AxisFault
           Product: Axis
           Version: current (nightly)
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@ws.apache.org
        ReportedBy: adam_craven@technologyonecorp.com


Hi,

This is not your typical serialization topic...

I am using the java:EJB provider, and I have an EJB method that I am exposing 
as a web service. This method throws an exception that inherits from AxisFault.

In my integration unit testing, when calling this ejb method and when the 
exception is thrown, the test client throws an InvalidClassException, saying 
that "the local class is not compatible ..." when it tries to unmarshal the 
AxisFault exception.

I found some information on serialization from Sun that talks about versioning 
of classes and serialVersionUID @ 
http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/class.doc6.html and 
it led me to a solution: 

I added the following as a class variable to AxisFault.java: 

*********************************************

       private static final long serialVersionUID = 1234567892345L;

*********************************************

... and I rebuilt everything and the test passed. 

I also found other web sites referring to the fact that different jdk versions 
(or even the same jdf version on different platforms) could implement the 
serialver program differently and thus cause the InvalidClassException if the 
variable is not specifed manually. This is a concern for me, because I believe 
the nightly build was done with jdk 1.4xx, and I am using jdk 1.3xx.

However, even when I recompiled Axis under jdk 1.3 and retested everything, the 
InvalidClassException still occurred. The only way I could fix the problem was 
to manually set the serialVersionUID in AxisFault.java.


Could someone please commit a serialVersionUID class variable into 
AxisFault.java, or suggest an alternative approach?

thanking you,

Adam