OFBiz
  1. OFBiz
  2. OFBIZ-4638

OFBiz does not build when using OpenJDK 7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: SVN trunk
    • Fix Version/s: SVN trunk
    • Component/s: ALL APPLICATIONS
    • Labels:
      None
    • Environment:

      Ubuntu 11.10

      $ java -version
      java version "1.7.0_147-icedtea"
      OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-0ubuntu0.11.10.1)
      OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)

      Description

      OFBiz does not build when using OpenJDK 7.

      The log with the error is attached.

      Thanks
      Sam

      1. java7.patch
        3 kB
        Chatree Srichart
      2. OpenJDK 7 Error.txt
        8 kB
        Sam Hamilton

        Issue Links

          Activity

          Hide
          Chatree Srichart added a comment -

          I attach a patch file to solve the problem. The problem is OpenJDK 7 and also Oracle JDK 7 do not cast nested Map's value to the defined generic type correctly.

          Show
          Chatree Srichart added a comment - I attach a patch file to solve the problem. The problem is OpenJDK 7 and also Oracle JDK 7 do not cast nested Map's value to the defined generic type correctly.
          Hide
          Hans Bakker added a comment -

          comments or enhancements, very welcome!

          Show
          Hans Bakker added a comment - comments or enhancements, very welcome!
          Hide
          Hans Bakker added a comment -

          Because of the rather large impact this patch could have, I would appreciate if our Java experts in the community could approve this patch?

          This patch will enable openJDK 6,7 while the sun JDK 6,7 also should work.

          Thanks you for your help in advance....

          Regards,
          Hans

          Show
          Hans Bakker added a comment - Because of the rather large impact this patch could have, I would appreciate if our Java experts in the community could approve this patch? This patch will enable openJDK 6,7 while the sun JDK 6,7 also should work. Thanks you for your help in advance.... Regards, Hans
          Hide
          Adrian Crum added a comment -

          If UtilMisc.<String, String>toMap compiles in OFBizSecurity.java, then why not use it in CommonServices.java also?

          Show
          Adrian Crum added a comment - If UtilMisc.<String, String>toMap compiles in OFBizSecurity.java, then why not use it in CommonServices.java also?
          Hide
          Jacques Le Roux added a comment -

          Adrian,

          Because noteDate is a Timestamp and not a String? Same than userLogin being a GenericValue and not a String in WorldPayEvents.java.

          BTW I wonder why/how both compile in Sun jdk 6. But also why the change in OFBizSecurity.java is only needed there (and not elsewhere: there are tons of other cases)

          Did I miss anything?

          Show
          Jacques Le Roux added a comment - Adrian, Because noteDate is a Timestamp and not a String? Same than userLogin being a GenericValue and not a String in WorldPayEvents.java. BTW I wonder why/how both compile in Sun jdk 6. But also why the change in OFBizSecurity.java is only needed there (and not elsewhere: there are tons of other cases) Did I miss anything?
          Hide
          Hans Bakker added a comment -

          anybody any objections committing this patch?

          Show
          Hans Bakker added a comment - anybody any objections committing this patch?
          Hide
          Anne Jessel added a comment -

          I don't have the right compilers to test this, but my editor says both the original and the patched versions of CommonServices and WorldPayEvents are incorrect. It says the fix is the same as for OFBizSecurity, namely to change UtilMisc.toMap(...) to be similar to UtilMisc.<String,String>toMap(...).

          Show
          Anne Jessel added a comment - I don't have the right compilers to test this, but my editor says both the original and the patched versions of CommonServices and WorldPayEvents are incorrect. It says the fix is the same as for OFBizSecurity, namely to change UtilMisc.toMap(...) to be similar to UtilMisc.<String,String>toMap(...).
          Hide
          Mark added a comment - - edited

          Oracle JDK 7 update 3 shows exactly the same behaviour as OpenJDK 7. It would seem to me a bit strange if core language components are different in OpenJDK and Oracle JDK. My best guess is that jdk 6 fails to recognize this as an error and therefore is a bug in jdk6...?

          Show
          Mark added a comment - - edited Oracle JDK 7 update 3 shows exactly the same behaviour as OpenJDK 7. It would seem to me a bit strange if core language components are different in OpenJDK and Oracle JDK. My best guess is that jdk 6 fails to recognize this as an error and therefore is a bug in jdk6...?
          Hide
          Mark added a comment -

          http://bugs.sun.com/view_bug.do?bug_id=6638712

          Fixed in openjdk 6+7 and Oracle JDK7, but obviously not in Oracle JDK 6.

          Show
          Mark added a comment - http://bugs.sun.com/view_bug.do?bug_id=6638712 Fixed in openjdk 6+7 and Oracle JDK7, but obviously not in Oracle JDK 6.
          Hide
          Jacques Le Roux added a comment -

          Thanks for report Mark,

          Maybe a reason to begin to turn to Java 7...

          Show
          Jacques Le Roux added a comment - Thanks for report Mark, Maybe a reason to begin to turn to Java 7...
          Hide
          Hans Bakker added a comment -

          committed revision 1299985
          Thank you Chattree for the contribution.

          Show
          Hans Bakker added a comment - committed revision 1299985 Thank you Chattree for the contribution.

            People

            • Assignee:
              Hans Bakker
              Reporter:
              Sam Hamilton
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development