8 Replies Latest reply on Apr 18, 2006 3:41 PM by clebert.suconic

    Java 5 and serialization

    timfox

      Hey Clebert-

      I've just updated serialization from CVS and it's failing to build on my box since I'm using JDK1.4.2 and now the code seems to contain some Java 5 specific stuff (Enums)

      JBossMessaging uses JBossSerialization and it needs to run on JDK1.4.x. We are doing a release today so can we get this fixed as a matter of urgency.

      Thanks.

        • 1. Re: Java 5 and serialization
          clebert.suconic

          You have to compile it using JDK 5.
          The produced runtime is compatible with JDK 1.4. But since I have to support enumerations, I need to compile it with 5.

          The feature that needs Enumeration is decoupled and there PersistManager does a test if the EnumPersister could be used or not.

          • 2. Re: Java 5 and serialization
            starksm64

            This sounds dangerous as there are many changes other than bytecode compatibility based on the stuff jbosstretro needs to do. Just compiling to a 1.4 target/source level does not validate that jdk5 specific classes have not been used. Explain what the serialization issues are as we may need to breakup serialization into a jdk5 specific piece, or create two artifacts.

            • 3. Re: Java 5 and serialization
              clebert.suconic

              But I'm not using any JDK 5 feature. (keywords).

              The only place I use *some* JDK 5 is on EnumerationPersister, and I'm only using API.

              "Scott Stark" wrote:

              Just compiling to a 1.4 target/source level does not validate that jdk5 specific classes have not been used.


              I have tested it with JDK 1.4 before releasing it. I will make the testsuite run automatically on JDK 1.5 and JDK 1.4. (maybe cruisecontrol)

              • 4. Re: Java 5 and serialization
                starksm64

                The keywords are not the problem. StringBuilder, new exception ctors, autoboxing, etc. are.

                • 5. Re: Java 5 and serialization
                  clebert.suconic

                  I will change compilation scripts for allowing compilation with JDK 1.4.

                  But Tim, did you find any problem running it with JDK 1.4?

                  If you did, it will completely change the priority on doing that.

                  • 6. Re: Java 5 and serialization
                    clebert.suconic

                    Just for the record, Ovidiu confirmed with me that JBossSerialization CR4 works with JDK 1.4 without any problems.

                    I will change compilation scripts to make sure I won't create any dependency on JDK 5 in the future.

                    • 7. Re: Java 5 and serialization
                      timfox

                      Good idea.

                      Forcing people to intsall JDK 1.5 to build for 1.4.2 doesn't strike me as the best design decision.

                      • 8. Re: Java 5 and serialization
                        clebert.suconic

                        http://jira.jboss.org/jira/browse/JBSER-62

                        Just separated JDK 1.4 and JDK 1.5 sources.

                        Still required to use JDK 1.5 for releases. (Code won't be compatible with enumerations if not using JDK 1.5)