1 2 Previous Next 20 Replies Latest reply: Sep 12, 2006 5:00 AM by Dimitris Andreadis RSS

JBAS-1854 - Compatibility 3.2.x vs 4.2.x

Clebert Suconic Master

I just executed a small portion of a compatibility test between 3.2.x and 4.2.x, and I've gotten serialization exceptions with GUID.

Then looking at the source code Guid under 3.2.x is not implementing SerialVersionUID.

So, can we add the SerialVersionUID on GUID@3.2.x from GUID@4.2.x?

  • 2. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Scott Stark Master

    For any serialVersionUID conflicts between 3.2.8 and 4.0.x we will have to do something like the following:

    import org.jboss.util.id.SerialVersion;
    
     /** @since 4.0.2, compatible with j2ee1.4 by default */
     final static long serialVersionUID;
     static
     {
     if (SerialVersion.version == SerialVersion.LEGACY)
     serialVersionUID = *the-402-serialVersionUID*;
     else
     serialVersionUID = *the-legacy-32x-serialVersionUID*;
     }
    


    The serialVersionUID compatibility mode is controlled by the org.jboss.j2ee.LegacySerialization system property existence as parsed in the org.jboss.util.id.SerialVersion class. The 328/402 interop is a conflicting definition with respect to legacy behavior for the SerialVersion class as for 4.0.2 legacy meant the 4.0.1 and 4.0.0.

    The default for 3.2.8 should be legacy interop with previous 3.2.x releases. Enabling interop with 4.0.x will break interop with previous 3.2.x releases so the user has to make that choice.


  • 3. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Clebert Suconic Master

    I know a hard way to discover what's the current serialVersionUID. (Write a program that creates a ObjectStreamClass and inspects the versionUID).

    but it would be great if we have something ready, or if any IDE has that as an option.

    Is there any easy way of doing it?

  • 4. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Dimitris Andreadis Master

    I'm trying to clarify the scope & setup of the compatibility tests:

    Is the scope of http://jira.jboss.com/jira/browse/JBAS-1854 a series of 3.2.8 client --> 4.0.2 server tests?

    The way I undestand the compatibility test suite, this is done in the 4.x branch by including the 3.2.8 clients libs.

    The 3.2.x branch, will test a 4.0.2 client targeting a 3.2.8 server.

    Are we doing both? And for every setup what exact library version are we using?

  • 5. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Clebert Suconic Master

    We are testing both ways:

    3.2.x server using:
    4.0.x client libraries (/client directory)
    4.0.2
    3.2.x (itself just to check the validity of the test)

    4.0.x server using:
    4.0.2
    4.0.2-sp1
    4.0.x (itself again just to check the validity of the test)
    and 3.2.x client libraries

  • 6. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Adrian Brock Master

     

    "clebert.suconic@jboss.com" wrote:

    but it would be great if we have something ready, or if any IDE has that as an option.

    Eclipse does it for you


    Is there any easy way of doing it?


    I use this ant script which uses the serialver command that is a part of the JDK

    <?xml version="1.0"?>
    
    
    
    <!-- ==========================================================================
    
    A template build file for building jboss3 applications
    
    Requires ant1.4+
    
    
    
    Distributable under the LGL
    
    See the terms of license at gnu.org
    
    =========================================================================== -->
    
    <project name="serialver" default="jboss" basedir=".">
    
    
    <property file="build.properties"/>
    
    <property file="$(user.home}/build.properties"/>
    
    
    
    <!-- ==========================================================================
    
    Run the client
    
    =========================================================================== -->
    
    <target name="jboss">
    
    
     <pathconvert targetos="unix" property="clientjars">
     <path>
     <fileset dir="${jboss.home}/client">
    
     <include name="*.jar"/>
    
     </fileset>
     <fileset dir="${jboss.home}/server/all/lib">
    
     <include name="*.jar"/>
    
     </fileset>
     </path>
     </pathconvert>
    
     <exec executable="serialver">
     <arg line="-classpath ${clientjars} ${class}"/>
     </exec>
    
    
    </target>
    
    
    <target name="j2ee">
    
    
     <pathconvert targetos="unix" property="clientjars">
     <path>
     <fileset dir="${j2ee.home}/lib">
    
     <include name="*.jar"/>
    
     </fileset>
     </path>
     </pathconvert>
    
     <exec executable="serialver">
     <arg line="-classpath ${clientjars} ${class}"/>
     </exec>
    
    
    </target>
    
    
    
    </project>
    


    e.g.
    ant -Dclass=org.jboss.some.Serializable

  • 7. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Dimitris Andreadis Master

    I added the missing serialVersionUID to GUID so that it has by default the "legacy" 3.2.x (and 4.0.0/4.0.1 possibly?) value, which is overriden by the 4.0.2+ value when the system property org.jboss.j2ee.Serialization is set.

    This is the opposite with 4.0.2+ where the property org.jboss.j2ee.LegacySerialization falls back to the 4.0.0/4.0.1 value.

    So my question now is, how testing of this stuff gets automated?

    When testing the server in Branch_3_2, we need to start it with -Dorg.jboss.j2ee.Serialization when testing using the 4.0.2/4.0.3SP1 client binaries. When testing using the 3.2.x client binaries the server must be started normally without the flag.

    I guess the same goes for the compatibility tests on Branch_4_0.

  • 8. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Adrian Brock Master

    Add a new parameter to the "scripts" in the testsuite that the jboss instances.

  • 9. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Dimitris Andreadis Master

    So the build.xml would needs to change so that for each client library set, it starts and stops the server, with whatever serialization setting.

    Otherwise we won't be able to run the tests agains the same version client binaries (e.g. 3.2.x -> 3.2.x)

  • 10. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Adrian Brock Master

    Yes. I would to be able to pass in two new options, e.g.

    ant test -Dtest=.... -Dclient.serialver=3.2.7 -Dserver.serialver=4.0.2
    


  • 11. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    ryan.campbell Expert

    Currently, we have -Dmatrix-versions which defines a directory with the following directory structure:

     jboss_3_2_x/*.jar
     jboss_3_2_7/*.jar
     jboss_3_2_6/*.jar
     jboss_4_0_x/*.jar
     jboss_4_0_2/*.jar
    


    So it sounds like we will want two "matrix-versions" directories?
     matrix-versions-3.2-legacy/
     jboss_3_2_6/*.jar
     jboss_3_2_7/*.jar
    
    and
     matrix-versions-3.2-j2ee/
     jboss_3_2_x/*.jar
     jboss_4_0_x/*.jar
     jboss_4_0_2/*.jar
     jboss_4_0_3/*.jar
    


    And the second matrix test run will pass the org.jboss.j2ee.Serialization flag to the server.



  • 12. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    Dimitris Andreadis Master

    That looks fine. Maybe we want jboss_3_2_x to be in the matrix-versions-3.2-legacy dir.

  • 13. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    ryan.campbell Expert

     

    "adrian@jboss.org" wrote:
    Yes. I would to be able to pass in two new options,


    Ok, I'll try this instead. At least the compatbility assertions will be in the build.xml instead of implicit in some directory structure this way.

  • 14. Re: JBAS-1854 - Compatibility 3.2.x vs 4.2.x
    ryan.campbell Expert

    So this is what I ended up with:

     <target name="tests-matrix"
     description="Executes only the version check compatibility suite. Use -Dmatrix-versions=[version container] for this task" depends="maybejars" if="matrix-versions">
     <test-compatibility client-version="3_2_7" serialization-flag=""/>
     <test-compatibility client-version="3_2_6" serialization-flag=""/>
     <test-compatibility client-version="3_2_x" serialization-flag=""/>
    
     <test-compatibility client-version="4_0_x" serialization-flag="-Dorg.jboss.j2ee.Serialization"/>
     <test-compatibility client-version="4_0_2" serialization-flag="-Dorg.jboss.j2ee.Serialization"/>
     <test-compatibility client-version="4_0_3" serialization-flag="-Dorg.jboss.j2ee.Serialization"/>
     <test-compatibility client-version="4_0_3SP1" serialization-flag="-Dorg.jboss.j2ee.Serialization"/>
    
     </target>
    


    The results of this test will be availble (shortly) here:
    http://cruisecontrol.jboss.com/cc/buildresults/jboss-3.2-compatibility-matrix

1 2 Previous Next