Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21524

[STAPLER] NullPointerException thrown when trying to use/define a Groovy Taglib

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • N/A

      Due to a bug in Stapler-Groovy, it is impossible for plugins to define/use custom Taglibs that are written in Groovy. Jelly taglibs work fine, but groovy taglibs always throw an NPE as can be seen here:

      http://jenkins-ci.361315.n4.nabble.com/Groovy-Taglibs-td4662779.html

      The reason is a bug in Stapler, that causes the Groovy File resolution to fail with an NPE. Additionally, it also does not search the entire ClassLoader tree, and thus is incapable of finding the Groovy files (which causes the above NPE in the first place).

      Replication of this issue is simple, by trying to create an empty Groovy taglib inside of a Plugin and then trying to use its tag from either a Groovy or Jelly UI file.

      DO NOTE: This issue does not appear for Jenkins-Core, because the core uses a different ClassLoader than the plugins. As such, Stapler will find the Groovy files in the outermost ClassLoader and thus not throw the NPE.

      The bug will be fixed as soon as the following patch is merged into the stapler source code and the Jenkins dependency to stapler updated:
      https://github.com/stapler/stapler/pull/31

          [JENKINS-21524] [STAPLER] NullPointerException thrown when trying to use/define a Groovy Taglib

          Martin Schröder created issue -
          Martin Schröder made changes -
          Description Original: Due to a bug in Stapler-Groovy, it is impossible for plugins to define/use custom Taglibs that are written in Groovy. Jelly taglibs work fine, but groovy taglibs always throw an NPE as can be seen here:

          http://jenkins-ci.361315.n4.nabble.com/Groovy-Taglibs-td4662779.html

          The reason is a bug in Stapler, that causes the Groovy File resolution to fail with an NPE. Additionally, it also does not search the entire ClassLoader tree, and thus is incapable of finding the Groovy files (which to the above NPE in the first place).


          Replication of this issue is simple, by trying to create an empty Groovy taglib and then trying to use its tag from either a Groovy or Jelly UI file.


          The bug will be fixed as soon as the following patch is merged into the stapler source code and the Jenkins dependency to stapler updated:
          https://github.com/stapler/stapler/pull/31
          New: Due to a bug in Stapler-Groovy, it is impossible for plugins to define/use custom Taglibs that are written in Groovy. Jelly taglibs work fine, but groovy taglibs always throw an NPE as can be seen here:

          http://jenkins-ci.361315.n4.nabble.com/Groovy-Taglibs-td4662779.html

          The reason is a bug in Stapler, that causes the Groovy File resolution to fail with an NPE. Additionally, it also does not search the entire ClassLoader tree, and thus is incapable of finding the Groovy files (which causes the above NPE in the first place).


          Replication of this issue is simple, by trying to create an empty Groovy taglib and then trying to use its tag from either a Groovy or Jelly UI file.


          The bug will be fixed as soon as the following patch is merged into the stapler source code and the Jenkins dependency to stapler updated:
          https://github.com/stapler/stapler/pull/31
          Martin Schröder made changes -
          Description Original: Due to a bug in Stapler-Groovy, it is impossible for plugins to define/use custom Taglibs that are written in Groovy. Jelly taglibs work fine, but groovy taglibs always throw an NPE as can be seen here:

          http://jenkins-ci.361315.n4.nabble.com/Groovy-Taglibs-td4662779.html

          The reason is a bug in Stapler, that causes the Groovy File resolution to fail with an NPE. Additionally, it also does not search the entire ClassLoader tree, and thus is incapable of finding the Groovy files (which causes the above NPE in the first place).


          Replication of this issue is simple, by trying to create an empty Groovy taglib and then trying to use its tag from either a Groovy or Jelly UI file.


          The bug will be fixed as soon as the following patch is merged into the stapler source code and the Jenkins dependency to stapler updated:
          https://github.com/stapler/stapler/pull/31
          New: Due to a bug in Stapler-Groovy, it is impossible for plugins to define/use custom Taglibs that are written in Groovy. Jelly taglibs work fine, but groovy taglibs always throw an NPE as can be seen here:

          http://jenkins-ci.361315.n4.nabble.com/Groovy-Taglibs-td4662779.html

          The reason is a bug in Stapler, that causes the Groovy File resolution to fail with an NPE. Additionally, it also does not search the entire ClassLoader tree, and thus is incapable of finding the Groovy files (which causes the above NPE in the first place).


          Replication of this issue is simple, by trying to create an empty Groovy taglib inside of a Plugin and then trying to use its tag from either a Groovy or Jelly UI file.

          DO NOTE: This issue does not appear for Jenkins-Core, because the core uses a different ClassLoader than the plugins. As such, Stapler will find the Groovy files in the outermost ClassLoader and thus not throw the NPE.


          The bug will be fixed as soon as the following patch is merged into the stapler source code and the Jenkins dependency to stapler updated:
          https://github.com/stapler/stapler/pull/31
          Jesse Glick made changes -
          Assignee Original: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Component/s Original: groovy [ 15549 ]
          Labels New: groovy stapler

          Daniel Beck added a comment -

          Daniel Beck added a comment - Fixed in https://github.com/stapler/stapler/commit/18567d8744addbfb27081d1c675c3b886a22e45b
          Daniel Beck made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 153521 ] New: JNJira + In-Review [ 194569 ]

            Unassigned Unassigned
            mhschroe Martin Schröder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: