OFBiz
  1. OFBiz
  2. OFBIZ-4749

OfBiz 10.04 Does not compile with Oracle JDK 7

    Details

      Description

      The OFBIZ version is apache-ofbiz-10.04

      When I'm compiling the project with the embedded and using ant run-install run there is a error message

      classes:
      [javac16] Compiling 13 source files to C:_portable\PortableApps\apache-ofbiz-10.04\framework\security\build\classes
      [javac16] warning: [options] bootstrap class path not set in conjunction with -source 1.6
      [javac16] C:_portable\PortableApps\apache-ofbiz-10.04\framework\security\src\org\ofbiz\security\OFBizSecurity.java:52: error: invalid inferred types for V; inferred type does not conform to declared bound(s)
      [javac16] protected static final Map<String, Map<String, String>> simpleRoleEntity = UtilMisc.toMap(
      [javac16] ^
      [javac16] inferred: Map<String,Object>
      [javac16] bound(s): Map<String,String>
      [javac16] where V,V1,V2,V3 are type-variables:
      [javac16] V extends Object declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
      [javac16] V1 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
      [javac16] V2 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
      [javac16] V3 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
      [javac16] 1 error
      [javac16] 1 warning

      Changing to use JDK 6 works around this issue - however given that EOL for JDK6 is November 2012 (IE this year, already extended from July) this is not a long term solution.

      Regards
      Karl

        Issue Links

          Activity

          Hide
          Jacques Le Roux added a comment -

          You may try to apply this to R10.04 http://svn.apache.org/viewvc?view=revision&revision=1299985
          If it works you could consider contributing a patch...

          Show
          Jacques Le Roux added a comment - You may try to apply this to R10.04 http://svn.apache.org/viewvc?view=revision&revision=1299985 If it works you could consider contributing a patch...
          Hide
          Paul Foxworthy added a comment -

          Can anyone confirm if the patch for OFBIZ-4387 fixes this issue?

          Show
          Paul Foxworthy added a comment - Can anyone confirm if the patch for OFBIZ-4387 fixes this issue?
          Hide
          Sergey Derevyanko added a comment -

          After patching new error appears. Build log is bellow.

          [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\product\product\ProductSearchEvents.java:317: error: invalid inferred types for V; inferred type does not conform to declared bound(s)
          [javac16] Map<String, String> messageMap = UtilMisc.toMap("numAdded", Integer.valueOf(numAdded), "productFeatureId", productFeatureId);
          [javac16] ^
          [javac16] inferred: Integer
          [javac16] bound(s): String
          [javac16] where V,V1,V2 are type-variables:
          [javac16] V extends Object declared in method <V,V1,V2>toMap(String,V1,String,V2)
          [javac16] V1 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2)
          [javac16] V2 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2)
          [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\product\product\ProductSearchEvents.java:367: error: invalid inferred types for V; inferred type does not conform to declared bound(s)
          [javac16] Map<String, String> messageMap = UtilMisc.toMap("numRemoved", Integer.valueOf(numRemoved), "productFeatureId", productFeatureId);
          [javac16] ^
          [javac16] inferred: Integer
          [javac16] bound(s): String
          [javac16] where V,V1,V2 are type-variables:
          [javac16] V extends Object declared in method <V,V1,V2>toMap(String,V1,String,V2)
          [javac16] V1 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2)
          [javac16] V2 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2)
          [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\product\product\ProductSearchSession.java:1231: error: no suitable method found for add(Map<String,Object>)
          [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] method List.add(int,Map<String,String>) is not applicable
          [javac16] (actual and formal argument lists differ in length)
          [javac16] method List.add(Map<String,String>) is not applicable
          [javac16] (actual argument Map<String,Object> cannot be converted to Map<String,String> by method invocation conversion)
          [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\shipment\shipment\ShipmentServices.java:1002: error: invalid inferred types for V; inferred type does not conform to declared bound(s)
          [javac16] Map<String, String> input = UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId, "userLogin", userLogin);
          [javac16] ^
          [javac16] inferred: GenericValue
          [javac16] bound(s): String
          [javac16] where V,V1,V2,V3 are type-variables:
          [javac16] V extends Object declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
          [javac16] V1 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
          [javac16] V2 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
          [javac16] V3 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3)
          [javac16] 4 errors
          [javac16] 1 warning

          Show
          Sergey Derevyanko added a comment - After patching new error appears. Build log is bellow. [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\product\product\ProductSearchEvents.java:317: error: invalid inferred types for V; inferred type does not conform to declared bound(s) [javac16] Map<String, String> messageMap = UtilMisc.toMap("numAdded", Integer.valueOf(numAdded), "productFeatureId", productFeatureId); [javac16] ^ [javac16] inferred: Integer [javac16] bound(s): String [javac16] where V,V1,V2 are type-variables: [javac16] V extends Object declared in method <V,V1,V2>toMap(String,V1,String,V2) [javac16] V1 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2) [javac16] V2 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2) [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\product\product\ProductSearchEvents.java:367: error: invalid inferred types for V; inferred type does not conform to declared bound(s) [javac16] Map<String, String> messageMap = UtilMisc.toMap("numRemoved", Integer.valueOf(numRemoved), "productFeatureId", productFeatureId); [javac16] ^ [javac16] inferred: Integer [javac16] bound(s): String [javac16] where V,V1,V2 are type-variables: [javac16] V extends Object declared in method <V,V1,V2>toMap(String,V1,String,V2) [javac16] V1 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2) [javac16] V2 extends V declared in method <V,V1,V2>toMap(String,V1,String,V2) [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\product\product\ProductSearchSession.java:1231: error: no suitable method found for add(Map<String,Object>) [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] method List.add(int,Map<String,String>) is not applicable [javac16] (actual and formal argument lists differ in length) [javac16] method List.add(Map<String,String>) is not applicable [javac16] (actual argument Map<String,Object> cannot be converted to Map<String,String> by method invocation conversion) [javac16] c:\Program Files\Apache Software Foundation\apache-ofbiz\applications\product\src\org\ofbiz\shipment\shipment\ShipmentServices.java:1002: error: invalid inferred types for V; inferred type does not conform to declared bound(s) [javac16] Map<String, String> input = UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId, "userLogin", userLogin); [javac16] ^ [javac16] inferred: GenericValue [javac16] bound(s): String [javac16] where V,V1,V2,V3 are type-variables: [javac16] V extends Object declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3) [javac16] V1 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3) [javac16] V2 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3) [javac16] V3 extends V declared in method <V,V1,V2,V3>toMap(String,V1,String,V2,String,V3) [javac16] 4 errors [javac16] 1 warning
          Hide
          Paul Foxworthy added a comment -

          Hi Sergey,

          The patch from OFBIZ-4387 should change these lines from Map<String, String> to Map<String, Object>, but your compile errors say Map<String, String>. I suspect the patch wasn't successfully applied. It only affects three lines of code, so you could make the changes by hand.

          Please let us know if this patch is all that is needed to make 10.04 compile with Oracle JDK 7.

          Cheers

          Paul Foxworthy

          Show
          Paul Foxworthy added a comment - Hi Sergey, The patch from OFBIZ-4387 should change these lines from Map<String, String> to Map<String, Object>, but your compile errors say Map<String, String>. I suspect the patch wasn't successfully applied. It only affects three lines of code, so you could make the changes by hand. Please let us know if this patch is all that is needed to make 10.04 compile with Oracle JDK 7. Cheers Paul Foxworthy
          Hide
          Sergey Derevyanko added a comment -

          As can I see from commit notice there were three files changed:
          ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java
          Directoryofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
          Directoryofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java,
          But now error occured in
          ProductSearchEvents.java:317
          ShipmentServices.java:1002
          ProductSearchSession.java:1231.
          I don't insist that I am right, but I had replace three files mentioned in patch description before restarted build.
          Regrads, Sergey.

          Show
          Sergey Derevyanko added a comment - As can I see from commit notice there were three files changed: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java Directoryofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java Directoryofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java, But now error occured in ProductSearchEvents.java:317 ShipmentServices.java:1002 ProductSearchSession.java:1231. I don't insist that I am right, but I had replace three files mentioned in patch description before restarted build. Regrads, Sergey.
          Hide
          Paul Foxworthy added a comment -

          Hi Sergey,

          We must be looking at two different things. The patch attached to OFBIZ-4387, which I think is relevant to your problem, affects ProductSearchEvents.java and ShipmentServices.java . Which commit notice are you looking at?

          The patch from OFBIZ-4387 doesn't touch ProductSearchSession. However, there was a change to that file in the trunk version at revision 1139858 which I think will fix your problem in 10.04. See https://fisheye6.atlassian.com/changelog/ofbiz?cs=1139858

          If you end up with a complete patch that fixes version 10.04 for Oracle JDK 7, please attach it to this Jira issue.

          Cheers

          Paul Foxworthy

          Show
          Paul Foxworthy added a comment - Hi Sergey, We must be looking at two different things. The patch attached to OFBIZ-4387 , which I think is relevant to your problem, affects ProductSearchEvents.java and ShipmentServices.java . Which commit notice are you looking at? The patch from OFBIZ-4387 doesn't touch ProductSearchSession. However, there was a change to that file in the trunk version at revision 1139858 which I think will fix your problem in 10.04. See https://fisheye6.atlassian.com/changelog/ofbiz?cs=1139858 If you end up with a complete patch that fixes version 10.04 for Oracle JDK 7, please attach it to this Jira issue. Cheers Paul Foxworthy
          Hide
          Sergey Derevyanko added a comment -

          Hi, Paul. You are right, we talked about different patch. Now, I guess, I did all right, have a look, please:
          1. Firstly I apply patch https://fisheye6.atlassian.com/changelog/ofbiz?cs=1167132 mentioned in OFBIZ-4387. But build was failed with error in classes that was changed in r1139858.
          2. After that I've applied patch that you mentioned: https://fisheye6.atlassian.com/changelog/ofbiz?cs=1139858. But errors occurred in class
          ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java.
          3. Finally I decided to apply patch http://svn.apache.org/viewvc?view=revision&revision=1299985, and one error is still occurred.

          Trace is bellow:
          :\Program Files\Apache Software Foundation\apache-ofbiz\applications\accounting\src\org\ofbiz\accounting\invoice\InvoiceServices.java:1004: error: no suitable method found for add(Map<String,Object>)
          [javac16] invoicesCreated.add(UtilMisc.toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom));
          [javac16] ^
          [javac16] method List.add(int,Map<String,String>) is not applicable
          [javac16] (actual and formal argument lists differ in length)
          [javac16] method List.add(Map<String,String>) is not applicable
          [javac16] (actual argument Map<String,Object> cannot be converted to Map<String,String> by method invocation conversion)
          [javac16] Note: Some input files use unchecked or unsafe operations.
          [javac16] Note: Recompile with -Xlint:unchecked for details.
          [javac16] 1 error

          Regards, Sergey.

          Show
          Sergey Derevyanko added a comment - Hi, Paul. You are right, we talked about different patch. Now, I guess, I did all right, have a look, please: 1. Firstly I apply patch https://fisheye6.atlassian.com/changelog/ofbiz?cs=1167132 mentioned in OFBIZ-4387 . But build was failed with error in classes that was changed in r1139858. 2. After that I've applied patch that you mentioned: https://fisheye6.atlassian.com/changelog/ofbiz?cs=1139858 . But errors occurred in class ofbiz/trunk/framework/security/src/org/ofbiz/security/OFBizSecurity.java. 3. Finally I decided to apply patch http://svn.apache.org/viewvc?view=revision&revision=1299985 , and one error is still occurred. Trace is bellow: :\Program Files\Apache Software Foundation\apache-ofbiz\applications\accounting\src\org\ofbiz\accounting\invoice\InvoiceServices.java:1004: error: no suitable method found for add(Map<String,Object>) [javac16] invoicesCreated.add(UtilMisc.toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom)); [javac16] ^ [javac16] method List.add(int,Map<String,String>) is not applicable [javac16] (actual and formal argument lists differ in length) [javac16] method List.add(Map<String,String>) is not applicable [javac16] (actual argument Map<String,Object> cannot be converted to Map<String,String> by method invocation conversion) [javac16] Note: Some input files use unchecked or unsafe operations. [javac16] Note: Recompile with -Xlint:unchecked for details. [javac16] 1 error Regards, Sergey.
          Hide
          Paul Foxworthy added a comment - - edited

          Hi Sergey,

          Thanks for your efforts here, it seems you're making progress.

          The trunk version of InvoiceServices had a change to

          invoicesCreated.add(UtilMisc.<String, String>toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom));

          in r1059352. See https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?r1=1059306&r2=1059352&u=3

          If that is the only error left, that's good. Once you have a 10.04 that builds and passes unit tests, please add a patch here. If it is easy for you, verifying that it still builds with JDK 6 would be good.

          Cheers

          Paul Foxworthy

          Show
          Paul Foxworthy added a comment - - edited Hi Sergey, Thanks for your efforts here, it seems you're making progress. The trunk version of InvoiceServices had a change to invoicesCreated.add(UtilMisc.<String, String>toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom)); in r1059352. See https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?r1=1059306&r2=1059352&u=3 If that is the only error left, that's good. Once you have a 10.04 that builds and passes unit tests, please add a patch here. If it is easy for you, verifying that it still builds with JDK 6 would be good. Cheers Paul Foxworthy
          Hide
          Sergey Derevyanko added a comment -

          Hi, Paul. Build successful! So now we have all necessary files for patch. I will prepare zip with all files little bit later because I am busy now. Thank you for your assistance.
          Regards, Sergey.

          Show
          Sergey Derevyanko added a comment - Hi, Paul. Build successful! So now we have all necessary files for patch. I will prepare zip with all files little bit later because I am busy now. Thank you for your assistance. Regards, Sergey.
          Hide
          Jacques Le Roux added a comment -

          Hi, I think nobody is in a hurry to use Oracle jdk 7 http://seclists.org/bugtraq/2012/Aug/225

          Show
          Jacques Le Roux added a comment - Hi, I think nobody is in a hurry to use Oracle jdk 7 http://seclists.org/bugtraq/2012/Aug/225
          Hide
          Jacques Le Roux added a comment -

          But we would be still interested to revies your changes Sergey, did you get a chance to continue?

          Show
          Jacques Le Roux added a comment - But we would be still interested to revies your changes Sergey, did you get a chance to continue?
          Hide
          Jacques Le Roux added a comment -

          This would be more interesting for the trunk BTW...

          Show
          Jacques Le Roux added a comment - This would be more interesting for the trunk BTW...
          Hide
          Sergey Derevyanko added a comment -

          Sorry, guys. Actually I forget to upload all files that must be patched. And I am very busy today, I will do little bit later.

          Show
          Sergey Derevyanko added a comment - Sorry, guys. Actually I forget to upload all files that must be patched. And I am very busy today, I will do little bit later.
          Hide
          Paul Foxworthy added a comment -

          Hi Jacques,

          I think Sergey was able to build 10.04 with Oracle JDK 7 by applying a series of patches that have already been applied to trunk. As far as I can tell there's nothing new for trunk here. Sergey, could you confirm that?

          It would be useful for anyone working with 10.04 to have one patch that combines the pieces discussed above, and once it exists we could consider a version 10 release that incorporates it.

          Show
          Paul Foxworthy added a comment - Hi Jacques, I think Sergey was able to build 10.04 with Oracle JDK 7 by applying a series of patches that have already been applied to trunk. As far as I can tell there's nothing new for trunk here. Sergey, could you confirm that? It would be useful for anyone working with 10.04 to have one patch that combines the pieces discussed above, and once it exists we could consider a version 10 release that incorporates it.
          Hide
          Jacques Le Roux added a comment -

          Hi Paul,

          Ha thanks, indeed that must be considered. So you tried trunk with Oracle JDK 7 and it works right?

          Show
          Jacques Le Roux added a comment - Hi Paul, Ha thanks, indeed that must be considered. So you tried trunk with Oracle JDK 7 and it works right?
          Hide
          Paul Foxworthy added a comment -

          Hi Jacques,

          No, we haven't tried 7 yet. We're sticking to 6 for now.

          Cheers

          Paul Foxworthy

          Show
          Paul Foxworthy added a comment - Hi Jacques, No, we haven't tried 7 yet. We're sticking to 6 for now. Cheers Paul Foxworthy
          Hide
          Jacques Le Roux added a comment -

          Actually I thought more about it. I don't think we will release a new 10 version to run with Oracle jdk 7. We never did that, OFBiz versions stick to the Java version they were developed with. Still if Sergey can provide the necessary it will be ketp here for those interested. So I don't close now but will close later with or w/out Sergey's files...

          Show
          Jacques Le Roux added a comment - Actually I thought more about it. I don't think we will release a new 10 version to run with Oracle jdk 7. We never did that, OFBiz versions stick to the Java version they were developed with. Still if Sergey can provide the necessary it will be ketp here for those interested. So I don't close now but will close later with or w/out Sergey's files...
          Hide
          Christian Geisert added a comment -

          This also happens with OpenJDK 6 (see OFBIZ-3993) so I think we should fix it.

          Show
          Christian Geisert added a comment - This also happens with OpenJDK 6 (see OFBIZ-3993 ) so I think we should fix it.
          Hide
          Jacques Le Roux added a comment -

          Agreed Christian, my point was about releasing 10.04 for jdk 7

          Show
          Jacques Le Roux added a comment - Agreed Christian, my point was about releasing 10.04 for jdk 7
          Show
          Paul Foxworthy added a comment - Hi Christian, Does 10.04 plus these four patches: https://fisheye6.atlassian.com/changelog/ofbiz?cs=1167132 https://fisheye6.atlassian.com/changelog/ofbiz?cs=1139858 https://fisheye6.atlassian.com/changelog/ofbiz?cs=1299985 https://fisheye6.atlassian.com/changelog/ofbiz?cs=1059352 build successfully with OpenJDK 6? Thanks Paul Foxworthy
          Hide
          Jacques Le Roux added a comment -

          Thanks Paul,

          Easier way to get the patches:

          https://fisheye6.atlassian.com/rdiff/ofbiz?csid=1167132&u&N
          etc.

          You still have to clean the pathes, I dont' know easier ways

          Show
          Jacques Le Roux added a comment - Thanks Paul, Easier way to get the patches: https://fisheye6.atlassian.com/rdiff/ofbiz?csid=1167132&u&N etc. You still have to clean the pathes, I dont' know easier ways
          Hide
          Jacques Le Roux added a comment -

          OK, I just tried and it works. Since the r1059352 patch does not apply completely, I simply changed the needed line by hand in InvoiceServices.java[104]:

          • invoicesCreated.add(UtilMisc.toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom));
            + invoicesCreated.add(UtilMisc.<String, String>toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom));

          Thanks a bunch Paul, this will help to move things forwards in some domains

          Show
          Jacques Le Roux added a comment - OK, I just tried and it works. Since the r1059352 patch does not apply completely, I simply changed the needed line by hand in InvoiceServices.java [104] : invoicesCreated.add(UtilMisc.toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom)); + invoicesCreated.add(UtilMisc.<String, String>toMap("commissionInvoiceId",invoiceId, "salesRepresentative ",partyIdBillFrom)); Thanks a bunch Paul, this will help to move things forwards in some domains
          Hide
          Jacques Le Roux added a comment -

          This has been fixed at
          R10.04 r1386469
          R11.04 r1386470

          I did not run the tests locally yet. They should be run by BuilBot later, let's see...

          Show
          Jacques Le Roux added a comment - This has been fixed at R10.04 r1386469 R11.04 r1386470 I did not run the tests locally yet. They should be run by BuilBot later, let's see...

            People

            • Assignee:
              Jacques Le Roux
              Reporter:
              Karl Laird
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development