OFBiz
  1. OFBiz
  2. OFBIZ-4865

Exception there when trying to update order's "Shipping Destination Address"

    Details

      Description

      If click the "update" button of "Shipping Destination Address" in order view page, an exception thrown out as:

      The Following Errors Occurred:

      BeanShell execution caused an error: Sourced file: inline evaluation of: `` shipmentMethod = parameters.get("shipmentMethod"); if(s . . . ''

      I'm not familiar with beanshell and the mechanism of how ofbiz handling it, but I'm sure that there'no such error days ago.

        Issue Links

          Activity

          Hide
          Jacopo Cappellato added a comment -

          could you please try to replace "${bsh:" with "${groovy:" in the script let that is throwing the error?

          Show
          Jacopo Cappellato added a comment - could you please try to replace "${bsh:" with "${groovy:" in the script let that is throwing the error?
          Hide
          Ankit Jain added a comment -

          This is happening because of the below code in "updateOrderItemShipGroup" service.

          <call-bsh><![CDATA[
          shipmentMethod = parameters.get("shipmentMethod");
          if(shipmentMethod != null)

          { arr = shipmentMethod.split( "@" ); parameters.put("shipmentMethodTypeId", arr[0]); parameters.put("carrierPartyId", arr[1]); parameters.put("carrierRoleTypeId", arr[2]); }

          ]]></call-bsh>

          Show
          Ankit Jain added a comment - This is happening because of the below code in "updateOrderItemShipGroup" service. <call-bsh><![CDATA[ shipmentMethod = parameters.get("shipmentMethod"); if(shipmentMethod != null) { arr = shipmentMethod.split( "@" ); parameters.put("shipmentMethodTypeId", arr[0]); parameters.put("carrierPartyId", arr[1]); parameters.put("carrierRoleTypeId", arr[2]); } ]]></call-bsh>
          Hide
          Paul Foxworthy added a comment -

          There was a change for OFBIZ-4389, trunk r1167116, to include the carrierRoleTypeId here. The carrierRoleTypeId should be present, because the ftl in r1167116 puts it there.

          It's possible that the exception is due to a missing carrierRoleTypeId. If as you say the problem occurs in trunk, I suspect you are doing something slightly different to me when I tested my patch.

          Can you confirm that carrierRoleTypeId is indeed missing, i.e. there are not two @ characters in the shipmentMethod parameter?

          I believe it should be there, because

          https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl?hb=true#to255

          puts it there.

          If it's missing, do a View Source in the browser and check what's listed in the options within the shipmentMethod.

          Can you reproduce the problem on the demo site?

          Cheers

          Paul Foxworthy

          Show
          Paul Foxworthy added a comment - There was a change for OFBIZ-4389 , trunk r1167116, to include the carrierRoleTypeId here. The carrierRoleTypeId should be present, because the ftl in r1167116 puts it there. It's possible that the exception is due to a missing carrierRoleTypeId. If as you say the problem occurs in trunk, I suspect you are doing something slightly different to me when I tested my patch. Can you confirm that carrierRoleTypeId is indeed missing, i.e. there are not two @ characters in the shipmentMethod parameter? I believe it should be there, because https://fisheye6.atlassian.com/browse/ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl?hb=true#to255 puts it there. If it's missing, do a View Source in the browser and check what's listed in the options within the shipmentMethod. Can you reproduce the problem on the demo site? Cheers Paul Foxworthy
          Hide
          Jacques Le Roux added a comment -

          Hi Leon,

          Please try to reproduce on trunk demo as suggested by Paul

          Thanks

          Show
          Jacques Le Roux added a comment - Hi Leon, Please try to reproduce on trunk demo as suggested by Paul Thanks
          Hide
          Leon added a comment -

          I searched the log and find the root cause is "java.lang.ArrayIndexOutOfBoundsException" from bsh script. As Paul told, there should be at least two "@" chars in "shipmentmethod" value. So I guess maybe somewhere "@" is missing. I tried to lookup for codes which construct parameters map for calling, and fortunately, I found it.

          See attached patch for detail.

          Thanks you all.

          Show
          Leon added a comment - I searched the log and find the root cause is "java.lang.ArrayIndexOutOfBoundsException" from bsh script. As Paul told, there should be at least two "@" chars in "shipmentmethod" value. So I guess maybe somewhere "@" is missing. I tried to lookup for codes which construct parameters map for calling, and fortunately, I found it. See attached patch for detail. Thanks you all.
          Hide
          Adrian Crum added a comment -

          Leon - I think you attached the wrong patch file.

          Show
          Adrian Crum added a comment - Leon - I think you attached the wrong patch file.
          Hide
          Leon added a comment -

          Adrian, Sorry for that. This one is correct.

          Show
          Leon added a comment - Adrian, Sorry for that. This one is correct.
          Hide
          Paul Foxworthy added a comment -

          Thanks Leon.

          My apologies for missing the call to updateOrderItemShipGroup from the updateOrderContactMech service in my OFBIZ-4389 patch.

          Show
          Paul Foxworthy added a comment - Thanks Leon. My apologies for missing the call to updateOrderItemShipGroup from the updateOrderContactMech service in my OFBIZ-4389 patch.
          Hide
          Ankit Jain added a comment -

          Adrian,

          I think it is because of Script changes, previously I found this type of issue in forms also.

          Show
          Ankit Jain added a comment - Adrian, I think it is because of Script changes, previously I found this type of issue in forms also.
          Hide
          Jacques Le Roux added a comment -

          Thanks Leon and Paul,

          Leon your patch is in
          trunk r1340352
          R12.04 r1340355
          R11.04 r1340354
          R10.04 r1340356
          R09.04 r1340353 (because of OFBIZ-4389)

          Show
          Jacques Le Roux added a comment - Thanks Leon and Paul, Leon your patch is in trunk r1340352 R12.04 r1340355 R11.04 r1340354 R10.04 r1340356 R09.04 r1340353 (because of OFBIZ-4389 )
          Hide
          Jacques Le Roux added a comment -

          Forgot Ankit and Adrian, thanks!

          Show
          Jacques Le Roux added a comment - Forgot Ankit and Adrian, thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development