Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Release Branch 10.04
    • Fix Version/s: Release Branch 10.04
    • Component/s: None
    • Labels:
      None
    • Environment:

      Fedora 10 + OpenJDK 1.6.0 (build 14.0-16) + OFBiz 10.04

      Description

      OFBiz cannot be built in OpenJDK 1.6.0 reported by fdap@free.fr:
      build:
      [echo] [build] ========== Start Building Framework (Compile) ==========
      .../...
      classes:
      [javac16] /srv/www/Ofbiz-10.04/common.xml:93: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
      [javac16] Compiling 55 source files to /srv/www/Ofbiz-10.04/applications/product/build/classes
      [javac16] /srv/www/Ofbiz-10.04/applications/product/src/org/ofbiz/product/product/ProductSearchSession.java:1231: cannot find symbol
      [javac16] symbol : method add(java.util.Map<java.lang.String,java.lang.Object>)
      [javac16] location: interface java.util.List<java.util.Map<java.lang.String,java.lang.String>>
      [javac16] featureCountList.add(UtilMisc.toMap("productFeatureId", (String) searchResult.get("pfacProductFeatureId"), "productFeatureTypeId", (String) searchResult.get("pfcProductFeatureTypeId"), "description", (String) searchResult.get("pfcDescription"), "featureCount", Long.toString((Long) searchResult.get("featureCount"))));
      [javac16] ^
      [javac16] 1 error

        Issue Links

          Activity

          Hide
          Shi Yusen added a comment -

          This patch can fix this build problem.

          Show
          Shi Yusen added a comment - This patch can fix this build problem.
          Hide
          Jacques Le Roux added a comment -

          Hi Shi,

          Interesting, could you explain why casting only the 1st element is enough (when there are more than one), and have you an idea why it's needed at all?

          Thanks

          Show
          Jacques Le Roux added a comment - Hi Shi, Interesting, could you explain why casting only the 1st element is enough (when there are more than one), and have you an idea why it's needed at all? Thanks
          Hide
          Shi Yusen added a comment -

          Hi Jacques,

          Do you mean this change:

          • bodyParts.add(UtilMisc.<String, Object>toMap("content", communicationEvent.getString("content"), "type", communicationEvent.getString("contentMimeTypeId")));
            + bodyParts.add(UtilMisc.<String, Object>toMap("content", (Object) communicationEvent.getString("content"), "type", communicationEvent.getString("contentMimeTypeId")));
            ?

          The (Object) added will make only method
          public static <V, V1 extends V, V2 extends V> Map<String, V> toMap(String name1, V1 value1, String name2, V2 value2)
          match the call. Or the new method added in the patch
          public static Map<String, String> toMap(String name1, String value1, String name2, String value2)

          { return new UtilMisc.SimpleMap<String>(name1, value1, name2, value2); }

          would be used.

          My premise in this patch is to make changes as few as possible.

          Regards,

          Show
          Shi Yusen added a comment - Hi Jacques, Do you mean this change: bodyParts.add(UtilMisc.<String, Object>toMap("content", communicationEvent.getString("content"), "type", communicationEvent.getString("contentMimeTypeId"))); + bodyParts.add(UtilMisc.<String, Object>toMap("content", (Object) communicationEvent.getString("content"), "type", communicationEvent.getString("contentMimeTypeId"))); ? The (Object) added will make only method public static <V, V1 extends V, V2 extends V> Map<String, V> toMap(String name1, V1 value1, String name2, V2 value2) match the call. Or the new method added in the patch public static Map<String, String> toMap(String name1, String value1, String name2, String value2) { return new UtilMisc.SimpleMap<String>(name1, value1, name2, value2); } would be used. My premise in this patch is to make changes as few as possible. Regards,
          Hide
          Jacques Le Roux added a comment -

          Ha, too fast! Seeing a repeated pattern I did not catch the new methods added in UtilMisc.java. I will have a new look...

          Thanks Shi!

          Show
          Jacques Le Roux added a comment - Ha, too fast! Seeing a repeated pattern I did not catch the new methods added in UtilMisc.java. I will have a new look... Thanks Shi!
          Hide
          Jacques Le Roux added a comment -

          Anyone tried this patch? I did not install Openjdk 1.6 yet, and I wonder if it will even work after compilation, experiences?

          Thanks

          Show
          Jacques Le Roux added a comment - Anyone tried this patch? I did not install Openjdk 1.6 yet, and I wonder if it will even work after compilation, experiences? Thanks
          Hide
          BJ Freeman added a comment - - edited

          java version "1.6.0_17"
          OpenJDK Runtime Environment (IcedTea6 1.7.5) (rhel-1.16.b17.el5-i386)
          OpenJDK Client VM (build 14.0-b16, mixed mode)

          all versions of ofbiz run under this
          I did have to compile on a different machine with Oracle JDK then copy the Jars over.
          this is an update and have not tried to compile
          will try this week

          Show
          BJ Freeman added a comment - - edited java version "1.6.0_17" OpenJDK Runtime Environment (IcedTea6 1.7.5) (rhel-1.16.b17.el5-i386) OpenJDK Client VM (build 14.0-b16, mixed mode) all versions of ofbiz run under this I did have to compile on a different machine with Oracle JDK then copy the Jars over. this is an update and have not tried to compile will try this week
          Hide
          Jacques Le Roux added a comment -

          Thanks BJ,

          Looking forward....

          Show
          Jacques Le Roux added a comment - Thanks BJ, Looking forward....
          Hide
          BJ Freeman added a comment -

          did a
          wget http://ci.apache.org/projects/ofbiz/snapshots/ofbiz-trunk-current.zip
          unzip -o ofbiz-trunk-current.zip
          ./ant clean-all

          > ./ant run-install
          Buildfile: build.xml

          ofbiz-init:

          build:
          [echo] [build] ========== Start Building (Compile) ==========

          ofbiz-init:

          dir-init:

          copy-derby-props:

          build:
          [echo] [build] ========== Start Building Framework (Compile) ==========

          BUILD FAILED
          /opt/apache/testcompile/build.xml:187: The following error occurred while executing this line:
          /opt/apache/testcompile/framework/build.xml:148: The following error occurred while executing this line:
          /opt/apache/testcompile/macros.xml:32: The following error occurred while executing this line:
          /opt/apache/testcompile/framework/start/build.xml:22: The following error occurred while executing this line:
          /opt/apache/testcompile/common.xml:59: Unable to create javax script engine for javascript

          Total time: 0 seconds

          Show
          BJ Freeman added a comment - did a wget http://ci.apache.org/projects/ofbiz/snapshots/ofbiz-trunk-current.zip unzip -o ofbiz-trunk-current.zip ./ant clean-all > ./ant run-install Buildfile: build.xml ofbiz-init: build: [echo] [build] ========== Start Building (Compile) ========== ofbiz-init: dir-init: copy-derby-props: build: [echo] [build] ========== Start Building Framework (Compile) ========== BUILD FAILED /opt/apache/testcompile/build.xml:187: The following error occurred while executing this line: /opt/apache/testcompile/framework/build.xml:148: The following error occurred while executing this line: /opt/apache/testcompile/macros.xml:32: The following error occurred while executing this line: /opt/apache/testcompile/framework/start/build.xml:22: The following error occurred while executing this line: /opt/apache/testcompile/common.xml:59: Unable to create javax script engine for javascript Total time: 0 seconds
          Hide
          Jacques Le Roux added a comment -

          Thanks BJ,

          Can you confirm that the same with Oracle SDK works?

          Show
          Jacques Le Roux added a comment - Thanks BJ, Can you confirm that the same with Oracle SDK works?
          Hide
          BJ Freeman added a comment -

          first I want to back track in commits to see if I can get rid of the Javax error
          and either get successful or the original error reported

          once that is done will check out oracle sdk since i don't have it installed on this machine.

          I did try the latest on windows and it runs.

          also the latest run on my Linux, no problem

          Show
          BJ Freeman added a comment - first I want to back track in commits to see if I can get rid of the Javax error and either get successful or the original error reported once that is done will check out oracle sdk since i don't have it installed on this machine. I did try the latest on windows and it runs. also the latest run on my Linux, no problem
          Hide
          Jacques Le Roux added a comment -

          Thanks for the help BJ!

          Show
          Jacques Le Roux added a comment - Thanks for the help BJ!
          Hide
          BJ Freeman added a comment -

          Looks like René Scheibe has addressed this in the Dev mailing list

          Show
          BJ Freeman added a comment - Looks like René Scheibe has addressed this in the Dev mailing list
          Hide
          BJ Freeman added a comment -

          don't have time right now to track down the error.
          it does not bother me because the binaries are generated on a separate work station then distributed to the production server.
          everything works in runtime mode.

          Show
          BJ Freeman added a comment - don't have time right now to track down the error. it does not bother me because the binaries are generated on a separate work station then distributed to the production server. everything works in runtime mode.
          Hide
          Jacques Le Roux added a comment -

          To make things more clear, last point (Unable to create javax script engine for javascript) has been addressed, see http://markmail.org/message/q7fta46wzavnopra

          Show
          Jacques Le Roux added a comment - To make things more clear, last point (Unable to create javax script engine for javascript) has been addressed, see http://markmail.org/message/q7fta46wzavnopra
          Hide
          Joe Bordes added a comment -

          I just checkedout 11.04 from http://svn.apache.org/repos/asf/ofbiz/branches/release11.04 and ran into this problem on my Ubuntu 11.10 with java:
          java version "1.6.0_23"
          OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.1)
          OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

          I took the patch that is attached to this ticket for 10.04 and applied it (with no problems) to 11.04. I then ran into similar problems in other parts of the application. Following the same idea of the original patch I changed other toMap() calls and compiled 11.04. Did some very basic testing, and all seems to be working correctly so I attach the adapted patch in case it can be validated or help others.

          Show
          Joe Bordes added a comment - I just checkedout 11.04 from http://svn.apache.org/repos/asf/ofbiz/branches/release11.04 and ran into this problem on my Ubuntu 11.10 with java: java version "1.6.0_23" OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.1) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) I took the patch that is attached to this ticket for 10.04 and applied it (with no problems) to 11.04. I then ran into similar problems in other parts of the application. Following the same idea of the original patch I changed other toMap() calls and compiled 11.04. Did some very basic testing, and all seems to be working correctly so I attach the adapted patch in case it can be validated or help others.
          Hide
          Jacques Le Roux added a comment -

          I wonder if we should still care about openjdl 1.6 or rather focus now on openjdl 1.7 and close this issue, opinions?

          Show
          Jacques Le Roux added a comment - I wonder if we should still care about openjdl 1.6 or rather focus now on openjdl 1.7 and close this issue, opinions?
          Hide
          Jacques Le Roux added a comment -

          I wonder if the changes applied for OFBIZ-4749 are not enough for this to be closed. Could someone test and confirm?

          Show
          Jacques Le Roux added a comment - I wonder if the changes applied for OFBIZ-4749 are not enough for this to be closed. Could someone test and confirm?
          Hide
          Christian Geisert added a comment -

          I just checked http://svn.apache.org/repos/asf/ofbiz/branches/release10.04 (Revision: 1387138) with
          java version "1.6.0_24", OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.11.10.1)
          and it did build and run the tests without problems

          Show
          Christian Geisert added a comment - I just checked http://svn.apache.org/repos/asf/ofbiz/branches/release10.04 (Revision: 1387138) with java version "1.6.0_24", OpenJDK Runtime Environment (IcedTea6 1.11.4) (6b24-1.11.4-1ubuntu0.11.10.1) and it did build and run the tests without problems
          Hide
          Jacques Le Roux added a comment -

          Thanks Christian!

          Show
          Jacques Le Roux added a comment - Thanks Christian!

            People

            • Assignee:
              Christian Geisert
              Reporter:
              Shi Yusen
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development