Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Release
    • Component/s: party
    • Labels:
      None

      Description

      Steps to regenerate:
      1. Go to Party Component (https://demo-trunk-ofbiz.apache.org:8443/partymgr/control/main)
      2. Create on Create Customer sub-menu (https://demo-trunk-ofbiz.apache.org:8443/partymgr/control/NewCustomer)
      3. Fill all the required fields and click on save button

      Expected result: Customer should be created successfully.

      Actual result: An error is thrown

      The Following Errors Occurred:
      Error running the simple-method: Error running groovy script [<br/> boolean useEncryption = "true".equals(org.apache.ofbiz.entity.util.EntityUtilProperties.getPropertyValue("security", "password.encrypt", delegator))<br/> if (useEncryption) { newUserLogin.set("currentPassword", org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))) }<br/> ]: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash() is applicable for argument types: (java.lang.String) values: [ofbiz]<br/>Possible solutions: digestHash(java.lang.String, [B) Method = createUser, File = file:/home/ofbizDemo/trunk/applications/party/minilang/user/UserEvents.xml, Element = <script>, Line 316null
      
      1. OFBIZ-9649_pluginAndOfbizPlugin.patch
        4 kB
        Ayushi Rathod
      2. OFBIZ-9649.patch
        1 kB
        Ayushi Rathod
      3. OFBIZ-9649.png
        474 kB
        Ayushi Rathod

        Activity

        Hide
        ayushirathod44 Ayushi Rathod added a comment -

        Quick Update:
        On Exploring the issue I found the following error on console :

        |W| Error running groovy script [
                        boolean useEncryption = "true".equals(org.apache.ofbiz.entity.util.EntityUtilProperties.getPropertyValue("security", "password.encrypt", delegator))
                        if (useEncryption) { newUserLogin.set("currentPassword", org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash((String) newUserLogin.get("currentPassword"))) }
                    ]: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash() is applicable for argument types: 
        

        On further exploring, I found that the HashCrypt.getDigestHash() method doesn't exist in HashCrypt.java. The method existed in the earlier version of Ofbiz (Ofbiz-16.12):

            /**
             * @deprecated use digestHash("SHA", null, str)
             */
            @Deprecated
            public static String getDigestHash(String str) {
                return digestHash("SHA", null, str);
            }
        
            /**
             * @deprecated use digestHash(hashType, null, str))
             */
            @Deprecated
            public static String getDigestHash(String str, String hashType) {
                return digestHash(hashType, null, str);
            }
        
            /**
             * @deprecated use digestHash(hashType, code, str);
             */
            @Deprecated
            public static String getDigestHash(String str, String code, String hashType) {
                return digestHash(hashType, code, str);
            }
        

        So what is expected here to fix this issue:
        1. If the methods were removed by mistake then, do we need to add getDigestHash() method again in HashCrypt.java
        2. Needs new implementation for the same.

        Show
        ayushirathod44 Ayushi Rathod added a comment - Quick Update: On Exploring the issue I found the following error on console : |W| Error running groovy script [ boolean useEncryption = " true " .equals(org.apache.ofbiz.entity.util.EntityUtilProperties.getPropertyValue( "security" , "password.encrypt" , delegator)) if (useEncryption) { newUserLogin.set( "currentPassword" , org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash(( String ) newUserLogin.get( "currentPassword" ))) } ]: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: static org.apache.ofbiz.base.crypto.HashCrypt.getDigestHash() is applicable for argument types: On further exploring, I found that the HashCrypt.getDigestHash() method doesn't exist in HashCrypt.java. The method existed in the earlier version of Ofbiz (Ofbiz-16.12): /** * @deprecated use digestHash( "SHA" , null , str) */ @Deprecated public static String getDigestHash( String str) { return digestHash( "SHA" , null , str); } /** * @deprecated use digestHash(hashType, null , str)) */ @Deprecated public static String getDigestHash( String str, String hashType) { return digestHash(hashType, null , str); } /** * @deprecated use digestHash(hashType, code, str); */ @Deprecated public static String getDigestHash( String str, String code, String hashType) { return digestHash(hashType, code, str); } So what is expected here to fix this issue: 1. If the methods were removed by mistake then, do we need to add getDigestHash() method again in HashCrypt.java 2. Needs new implementation for the same.
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Hi Ayushi,
        I think methods were removed at revision 1804880 by Jacques as they were deprecated methods which can be replaced with digestHash() methods.
        Refer the link:
        http://markmail.org/message/c6d7ukjaldzpng7l

        Show
        aditya.sharma Aditya Sharma added a comment - Hi Ayushi, I think methods were removed at revision 1804880 by Jacques as they were deprecated methods which can be replaced with digestHash() methods. Refer the link: http://markmail.org/message/c6d7ukjaldzpng7l
        Hide
        ayushirathod44 Ayushi Rathod added a comment -

        Thanks Aditya Sharma for the inputs.

        Now called the method HashCrypt.digestHash() instead HashCrypt.getDigestHash(). The patch has been attached below:
        OFBIZ-9649.patch

        Show
        ayushirathod44 Ayushi Rathod added a comment - Thanks Aditya Sharma for the inputs. Now called the method HashCrypt. digestHash () instead HashCrypt. getDigestHash (). The patch has been attached below: OFBIZ-9649.patch
        Hide
        ayushirathod44 Ayushi Rathod added a comment -

        While working on this bug, I found that the HashCrypt.getDigestHash() is called from multiple files.
        I am providing a separate patch for the same, please find the patch below:

        OFBIZ-9649_pluginAndOfbizPlugin.patch

        Show
        ayushirathod44 Ayushi Rathod added a comment - While working on this bug, I found that the HashCrypt.getDigestHash() is called from multiple files. I am providing a separate patch for the same, please find the patch below: OFBIZ-9649_pluginAndOfbizPlugin.patch
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Ayushi and Aditya, well spoted.

        Indeed, I missed to look in other files than Java, hence the misses.

        Ayushi, in your patch you have duplicates. Maybe because you followed the way I suggest to use Eclipse in the "Eclipse tips" wiki page. Your duplicates were not a problem, I used only the ones which starts with "plugins". I found another instance in UserEvents.xml, there are no others in any files.

        Ayushi your modified patch (I also refactored things a bit) is in trunk at revision: 1806332, no branches are concerned.

        Great collaboration

        OK, I got an issue I must report. Long story short: in Eclipse I was initially able to change the 2 plugins files in ofbiz/plugins (project) and able to commit them with UserEvents.xml selecting the 3 files in the Eclipse search view. But then it was refused by svn because my plugins svn instance was not up to date. I stupidily updated out of Eclipse (using TortoiseSvn, I'm too much used to it) and after that, though trying hard, I did not find a way to commit the 3 files in the same commit. Before giving up, in the Eclipse search view I was able to select UserEvents.xml and ScrumEvents.xml but not QuickAnonCustomerEvents.xml, Subclipse knows why :/. Once again TortoiseSvn saved my ass and I was able to commit the 3 files in the same commit usint it, lesson learned (the hard way).

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Ayushi and Aditya, well spoted. Indeed, I missed to look in other files than Java, hence the misses. Ayushi, in your patch you have duplicates. Maybe because you followed the way I suggest to use Eclipse in the "Eclipse tips" wiki page. Your duplicates were not a problem, I used only the ones which starts with "plugins". I found another instance in UserEvents.xml, there are no others in any files. Ayushi your modified patch (I also refactored things a bit) is in trunk at revision: 1806332, no branches are concerned. Great collaboration OK, I got an issue I must report. Long story short: in Eclipse I was initially able to change the 2 plugins files in ofbiz/plugins (project) and able to commit them with UserEvents.xml selecting the 3 files in the Eclipse search view. But then it was refused by svn because my plugins svn instance was not up to date. I stupidily updated out of Eclipse (using TortoiseSvn, I'm too much used to it) and after that, though trying hard, I did not find a way to commit the 3 files in the same commit. Before giving up, in the Eclipse search view I was able to select UserEvents.xml and ScrumEvents.xml but not QuickAnonCustomerEvents.xml, Subclipse knows why :/. Once again TortoiseSvn saved my ass and I was able to commit the 3 files in the same commit usint it, lesson learned (the hard way).
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Ah sorry Ayushi I did not notice your OFBIZ-9649.patch, so you covered also UserEvents.xml.
        I fixed a typo I made in r1806332 at r1806335

        Show
        jacques.le.roux Jacques Le Roux added a comment - Ah sorry Ayushi I did not notice your OFBIZ-9649 .patch, so you covered also UserEvents.xml. I fixed a typo I made in r1806332 at r1806335
        Hide
        ayushirathod44 Ayushi Rathod added a comment -
        Show
        ayushirathod44 Ayushi Rathod added a comment - Thanks Jacques Le Roux !

          People

          • Assignee:
            jacques.le.roux Jacques Le Roux
            Reporter:
            ayushirathod44 Ayushi Rathod
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development