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

CMS shows error screen on clicking Find button

    Details

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

      Description

      Steps to regenerate :
      1. Log in to Content component
      2. Go to the CMS tab or directly go to https://localhost:8443/content/control/CMSContentFind
      3. Click on "Find" submenu or directly go to https://localhost:8443/content/control/AdminSearch
      4. Screen renders with ScreenRenderingException

      1. OFBIZ-9301.patch
        2 kB
        Renuka Srishti
      2. OFBIZ-9301.patch
        2 kB
        Aditya Sharma
      3. screenshot-1.png
        91 kB
        Aditya Sharma

        Activity

        Hide
        aditya.sharma Aditya Sharma added a comment -

        Problem:
        1. "AdminSearch" request directs to "AdminSearch" screen in LuceneScreens.xml.
        2. On AdminSearch screen, "Search.groovy" script prepares and hits a search query to Lucene.
        3. "BooleanQuery" class is used to match documents with other boolean query combinations.
        4. BooleanQuery object is initialised with Its default constructor.
        5. With Lucene 5.4.0, this constructor is deprecated.

        OFBiz migrated to Lucene 6.3.1:

        OFBIZ-8316

        Solution:
        From Lucene 5.4.0 default constructor is deprecated and a new inner class Builder is created for queries.

        References:

        https://lucene.apache.org/core/5_4_0/core/deprecated-list.html#constructor

        BooleanQuery Class documentation:
        https://lucene.apache.org/core/5_4_0/core/org/apache/lucene/search/BooleanQuery.html

        BooleanQuery.Builder Class documentation:
        https://lucene.apache.org/core/5_4_0/core/org/apache/lucene/search/BooleanQuery.Builder.html

        Show
        aditya.sharma Aditya Sharma added a comment - Problem: 1. "AdminSearch" request directs to "AdminSearch" screen in LuceneScreens.xml. 2. On AdminSearch screen, "Search.groovy" script prepares and hits a search query to Lucene. 3. "BooleanQuery" class is used to match documents with other boolean query combinations. 4. BooleanQuery object is initialised with Its default constructor. 5. With Lucene 5.4.0, this constructor is deprecated. OFBiz migrated to Lucene 6.3.1: OFBIZ-8316 Solution: From Lucene 5.4.0 default constructor is deprecated and a new inner class Builder is created for queries. References: https://lucene.apache.org/core/5_4_0/core/deprecated-list.html#constructor BooleanQuery Class documentation: https://lucene.apache.org/core/5_4_0/core/org/apache/lucene/search/BooleanQuery.html BooleanQuery.Builder Class documentation: https://lucene.apache.org/core/5_4_0/core/org/apache/lucene/search/BooleanQuery.Builder.html
        Hide
        aditya.sharma Aditya Sharma added a comment -

        The problem must be present on other places too where Lucene is used.

        https://demo-trunk-ofbiz.apache.org:8443/ecommerce/control/searchContent

        So will create a separate ticket to update all the occurrences.

        Show
        aditya.sharma Aditya Sharma added a comment - The problem must be present on other places too where Lucene is used. https://demo-trunk-ofbiz.apache.org:8443/ecommerce/control/searchContent So will create a separate ticket to update all the occurrences.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Hi Aditya,

        I have applied your patch (please create them from root dir) but now get on screen

        org.apache.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen [component://lucene/widget/LuceneScreens.xml#AdminSearch]: java.lang.IllegalArgumentException: Error running script at location [component://lucene/groovyScripts/content/Search.groovy]: groovy.lang.MissingPropertyException: No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder (Error running script at location [component://lucene/groovyScripts/content/Search.groovy]: groovy.lang.MissingPropertyException: No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder)
        

        In log

        2017-04-08 10:05:01,561 |http-nio-8443-exec-3 |                              |I| menuContext(0):[:]
        2017-04-08 10:05:01,733 |http-nio-8443-exec-3 |ScriptUtil                    |W| Error running script at location [component://lucene/groovyScripts/content/Search.groovy]: groovy.lang.MissingPropertyException
        : No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder
        groovy.lang.MissingPropertyException: No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder
         at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) ~[groovy-all-2.4.10.jar:2.4.10]
             at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:66) ~[groovy-all-2.4.10.jar:2.4.10]
         at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296) ~[groovy-all-2.4.10.jar:2.4.10]
            at Search.run(Search.groovy:100) ~[?:?]
        

        I checked "import org.apache.lucene.search.*" is in.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Hi Aditya, I have applied your patch (please create them from root dir) but now get on screen org.apache.ofbiz.widget.renderer.ScreenRenderException: Error rendering screen [component: //lucene/widget/LuceneScreens.xml#AdminSearch]: java.lang.IllegalArgumentException: Error running script at location [component://lucene/groovyScripts/content/Search.groovy]: groovy.lang.MissingPropertyException: No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder (Error running script at location [component://lucene/groovyScripts/content/Search.groovy]: groovy.lang.MissingPropertyException: No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder) In log 2017-04-08 10:05:01,561 |http-nio-8443-exec-3 | |I| menuContext(0):[:] 2017-04-08 10:05:01,733 |http-nio-8443-exec-3 |ScriptUtil |W| Error running script at location [component: //lucene/groovyScripts/content/Search.groovy]: groovy.lang.MissingPropertyException : No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder groovy.lang.MissingPropertyException: No such property: build for class: org.apache.lucene.search.BooleanQuery$Builder at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:66) ~[groovy-all-2.4.10.jar:2.4.10] at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296) ~[groovy-all-2.4.10.jar:2.4.10] at Search.run(Search.groovy:100) ~[?:?] I checked "import org.apache.lucene.search.*" is in.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thanks Aditya,

        Your modified patch is in at revision 1790664. I sorted the imports by hand, and added missing parenthesis at ".build" (2 places)

        It seems R16.11 has not this problem, but OFBIZ-8316 must be clarified.

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thanks Aditya, Your modified patch is in at revision 1790664. I sorted the imports by hand, and added missing parenthesis at ".build" (2 places) It seems R16.11 has not this problem, but OFBIZ-8316 must be clarified.
        Hide
        aditya.sharma Aditya Sharma added a comment -

        Sure Jacques I will ensure that. Thanks for applying my patch

        Show
        aditya.sharma Aditya Sharma added a comment - Sure Jacques I will ensure that. Thanks for applying my patch
        Hide
        Renuka_Srishti Renuka Srishti added a comment - - edited

        I think these changes are reverted in revision:1794770, so need to apply this patch again.
        Hence reopening http://markmail.org/message/x5wjustjvpf3jyqv

        Show
        Renuka_Srishti Renuka Srishti added a comment - - edited I think these changes are reverted in revision:1794770, so need to apply this patch again. Hence reopening http://markmail.org/message/x5wjustjvpf3jyqv
        Hide
        deepak.dixit Deepak Dixit added a comment -

        Thanks Renuka for reporting this, this has been fixed at plugins trunk at r#1802365

        Backport not needed as this is belong to trunk only.

        Show
        deepak.dixit Deepak Dixit added a comment - Thanks Renuka for reporting this, this has been fixed at plugins trunk at r#1802365 Backport not needed as this is belong to trunk only.
        Hide
        jacques.le.roux Jacques Le Roux added a comment -

        Thank you guys!

        Show
        jacques.le.roux Jacques Le Roux added a comment - Thank you guys!

          People

          • Assignee:
            deepak.dixit Deepak Dixit
            Reporter:
            aditya.sharma Aditya Sharma
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development