Uploaded image for project: 'Job Macro'
  1. Job Macro
  2. JOBMACRO-17

Java class from installed jar extension is not visible in the groovy code of a job macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.1
    • 2.0
    • None
    • XWiki 15.10.6
    • Unknown

    Description

      This seems to only impact some versions of XWiki, not all of them.

      With XWiki 15.10.6 I reproduced the following:

      • installed the publication workflow contrib extension on a subwiki
        • the job macro is also installed on the subwiki (in case it matters)
      • in a groovy macro in a job macro on that subwiki, I used the following code:
      def publicationRoles = services.component.getInstance(org.xwiki.workflowpublication.PublicationRoles.class)
      
      • ran the job

      Expected result

      • the publicationRoles variable is initialized to the default implementation of the PublicationRoles class

      Actual result

      • if the code is surrounded by try-catch in groovy and the error is logged, an error is caught saying

      No such property: org for class: Script16
      class groovy.lang.MissingPropertyException: No such property: org for class: Script16

      This is the error that groovy returns when it doesn't "know" the type passed.

      Attachments

        Activity

          People

            lucaa Anca Luca
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: