Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5632

Changing Visual theme in Order manager results in error message

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Release Branch 13.07, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 11.04.07, 13.07.02
    • Component/s: order
    • Labels:
      None
    • Environment:

      Primarily tested on Ubuntu, but affects all OS.

      Description

      The reported issue has been observed in the order manager application. It happens when there's no shopping cart in the session.

      Steps to test -
      1. Try changing visual theme in the order manager application.

      Observations -
      1. Returns ERROR MESSAGE - org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen component://order/widget/ordermgr/OrderEntryOrderScreens.xml#quickFinalizeOrder: java.lang.IllegalArgumentException: Error running script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy]: java.lang.NullPointerException: Cannot invoke method getRelated() on null object (Error running script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy]: java.lang.NullPointerException: Cannot invoke method getRelated() on null object)

      Thanks.

      1. RemoveCart.png
        308 kB
        HotWax Media OFBiz Team
      2. OFBIZ-5632_trunk_13.07.patch
        0.7 kB
        Pranay Pandey
      3. OFBIZ-5632_12.04.patch
        0.7 kB
        Pranay Pandey
      4. ChangeVisualTheme.png
        300 kB
        HotWax Media OFBiz Team

        Activity

        Hide
        toashishvijay Ashish Vijaywargiya added a comment -

        Thanks Vyom for creating the issue. Thanks Pranay for providing the patch and participation in discussion. Your changes are committed in the following revisions:

        trunk - r1632733
        RB13.07 - r1632734
        RB12.04 - r1632790

        Show
        toashishvijay Ashish Vijaywargiya added a comment - Thanks Vyom for creating the issue. Thanks Pranay for providing the patch and participation in discussion. Your changes are committed in the following revisions: trunk - r1632733 RB13.07 - r1632734 RB12.04 - r1632790
        Hide
        pandeypranay Pranay Pandey added a comment -

        Patches for fixing this issue for 12.04, 13.04 and trunk.

        Show
        pandeypranay Pranay Pandey added a comment - Patches for fixing this issue for 12.04, 13.04 and trunk.
        Hide
        pandeypranay Pranay Pandey added a comment -

        This is not a random issue but can be regenerated easily on 12.04, 13.07 and Trunk. You have to try completing order with option "Quick Finalize Order". As order processed successfully change theme and error will be shown as given by Deepak.

        Last view being rendered as user sets his theme preference is causing it. At this time last view being rendered is "quickcheckout" which is actually the cause of the problem.

        Show
        pandeypranay Pranay Pandey added a comment - This is not a random issue but can be regenerated easily on 12.04, 13.07 and Trunk. You have to try completing order with option "Quick Finalize Order". As order processed successfully change theme and error will be shown as given by Deepak. Last view being rendered as user sets his theme preference is causing it. At this time last view being rendered is "quickcheckout" which is actually the cause of the problem.
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Here is the error from demo instance

        2014-09-27 12:41:55,328 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:208:ERROR] Got a insecure (non-https) form POST to a secure (http) request [setUserPreference], returning error
        2014-09-27 12:41:55,328 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:226:WARN ] HTTPS is disabled for this site, so we can't tell if this was encrypted or not which means if a form was POSTed and it was not over HTTPS we don't know, but it would be vulnerable to an XSRF and other attacks: Not accepting insecure form data posted to a secure request
        2014-09-27 12:41:55,361 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:661:INFO ] Ran Event service:#setUserPreference from [request], result is [success]
        2014-09-27 12:41:55,362 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:766:INFO ] Rendering View [quickcheckout], sessionId=22BF8627BD39C87C3AFDB82AD172D870.jvm1
        2014-09-27 12:41:55,397 (http-bio-0.0.0.0-28080-exec-20) [ ScreenFactory.java:130:INFO ] Got 15 screens in 0.005s from: file:/home/ofbizDemo/branch12.4/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml
        2014-09-27 12:41:55,430 (http-bio-0.0.0.0-28080-exec-20) [ ScriptUtil.java:347:WARN ]
        ---- exception report ----------------------------------------------------------
        Error running script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy]: javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getCurrency() on null object
        Exception: javax.script.ScriptException
        Message: java.lang.NullPointerException: Cannot invoke method getCurrency() on null object
        ---- cause ---------------------------------------------------------------------
        Exception: java.lang.NullPointerException

        Show
        deepak.dixit Deepak Dixit added a comment - Here is the error from demo instance 2014-09-27 12:41:55,328 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:208:ERROR] Got a insecure (non-https) form POST to a secure (http) request [setUserPreference] , returning error 2014-09-27 12:41:55,328 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:226:WARN ] HTTPS is disabled for this site, so we can't tell if this was encrypted or not which means if a form was POSTed and it was not over HTTPS we don't know, but it would be vulnerable to an XSRF and other attacks: Not accepting insecure form data posted to a secure request 2014-09-27 12:41:55,361 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:661:INFO ] Ran Event service:#setUserPreference from [request] , result is [success] 2014-09-27 12:41:55,362 (http-bio-0.0.0.0-28080-exec-20) [ RequestHandler.java:766:INFO ] Rendering View [quickcheckout] , sessionId=22BF8627BD39C87C3AFDB82AD172D870.jvm1 2014-09-27 12:41:55,397 (http-bio-0.0.0.0-28080-exec-20) [ ScreenFactory.java:130:INFO ] Got 15 screens in 0.005s from: file:/home/ofbizDemo/branch12.4/applications/order/widget/ordermgr/OrderEntryOrderScreens.xml 2014-09-27 12:41:55,430 (http-bio-0.0.0.0-28080-exec-20) [ ScriptUtil.java:347:WARN ] ---- exception report ---------------------------------------------------------- Error running script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy] : javax.script.ScriptException: java.lang.NullPointerException: Cannot invoke method getCurrency() on null object Exception: javax.script.ScriptException Message: java.lang.NullPointerException: Cannot invoke method getCurrency() on null object ---- cause --------------------------------------------------------------------- Exception: java.lang.NullPointerException
        Hide
        deepak.dixit Deepak Dixit added a comment -

        This issue exists for relase12.04 branch.
        Here are the steps to regenerate issue:

        • Go to ordermgr select customer, product
        • Click on finalize order
        • Click on create order button
        • After creating order screen will be redirected to order view page
        • Now click on Visual Theme link to change the theme
        • Select any theme now you will get an error.

        It might be possible that due to some framework level enhancement/fixes this issue has been fixed in trunk. release13.07 branch.

        Show
        deepak.dixit Deepak Dixit added a comment - This issue exists for relase12.04 branch. Here are the steps to regenerate issue: Go to ordermgr select customer, product Click on finalize order Click on create order button After creating order screen will be redirected to order view page Now click on Visual Theme link to change the theme Select any theme now you will get an error. It might be possible that due to some framework level enhancement/fixes this issue has been fixed in trunk. release13.07 branch.
        Hide
        hwmofbizus HotWax Media OFBiz Team added a comment -

        1. I tried to regenerate issue by removing cart from the session and changing themes from all the available visual themes in the order manager application but no error message generated.
        2. I have also tried to change default theme (Tomahawk) to Flat Grey and also tried to change other themes but no error message generated.

        Show
        hwmofbizus HotWax Media OFBiz Team added a comment - 1. I tried to regenerate issue by removing cart from the session and changing themes from all the available visual themes in the order manager application but no error message generated. 2. I have also tried to change default theme (Tomahawk) to Flat Grey and also tried to change other themes but no error message generated.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        I could do that but it would mask the issue, we need to find the cause.

        Show
        jacques.le.roux Jacques Le Roux added a comment - I could do that but it would mask the issue, we need to find the cause.
        Hide
        vyom0213@gmail.com Vyom Jain added a comment -

        Its random and has happened more than once on a system with no customizations.
        May be review CheckoutPayment.groovy and identify statements prone to NPE?

        Show
        vyom0213@gmail.com Vyom Jain added a comment - Its random and has happened more than once on a system with no customizations. May be review CheckoutPayment.groovy and identify statements prone to NPE?
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        We need more details to reproduce. I was not able after:

        1. Getting from catalog app to order app
        2. Changing from default theme (Tomahawk) to Flat Grey

        Please give all the steps with details, or close if you can't reproduce

        Show
        jacques.le.roux Jacques Le Roux added a comment - We need more details to reproduce. I was not able after: Getting from catalog app to order app Changing from default theme (Tomahawk) to Flat Grey Please give all the steps with details, or close if you can't reproduce

          People

          • Assignee:
            toashishvijay Ashish Vijaywargiya
            Reporter:
            vyom0213@gmail.com Vyom Jain
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development