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

Update to version 1.22: ClassNotFoundException: com.joelj.jenkins.eztemplates.InheritenceStep.EzTemplateBuilder

    XMLWordPrintable

Details

    Description

      Updating the Multijob-plugin to version 1.22 broke our Jenkins instance.

      probably caused by https://github.com/jenkinsci/tikal-multijob-plugin/pull/75
      I searched the entire internet but could not find any EzTemplateBuilder class... and there is no version 1.0.5 in https://github.com/jenkinsci/ez-templates-plugin

      This exception happened when accessing a Hierarchy view:

      Caused by: java.lang.NoClassDefFoundError: com/joelj/jenkins/eztemplates/InheritenceStep/EzTemplateBuilder
      at com.tikal.jenkins.plugins.multijob.views.MultiJobView.addMultiProject(MultiJobView.java:127)
      at com.tikal.jenkins.plugins.multijob.views.MultiJobView.addTopLevelProject(MultiJobView.java:112)
      at com.tikal.jenkins.plugins.multijob.views.MultiJobView.getItems(MultiJobView.java:97)
      ... 102 more
      Caused by: java.lang.ClassNotFoundException: com.joelj.jenkins.eztemplates.InheritenceStep.EzTemplateBuilder
      at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
      at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
      at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 105 more

      Attachments

        Issue Links

          Activity

            cobexer Ing. Christoph Obexer created issue -
            cobexer Ing. Christoph Obexer made changes -
            Field Original Value New Value
            Assignee hagzag [ hagzag ]
            hagzag hagzag added a comment -

            Looking into it, seems like either rolling back || adding EZ templates as a dependency, hope to test and release / update shortly.
            meanwhile could you please verify installing the EZ templates plugin solves the issue ?

            10x
            HP

            hagzag hagzag added a comment - Looking into it, seems like either rolling back || adding EZ templates as a dependency, hope to test and release / update shortly. meanwhile could you please verify installing the EZ templates plugin solves the issue ? 10x HP
            hagzag hagzag added a comment -

            I couldn't re-produce this use case ... EZtemplates is now a dependency of the MultiJob plugin considering the mentioned integration / EZtempaltes support.
            I also upgraded the version of EZtemplates to the latest version and still couldn't re-produce.

            Could you please send me the following info:
            1. Jenkins core version
            2. EZtemplates plugin version

            Anything else you may think is relevant so I can double check.

            hagzag hagzag added a comment - I couldn't re-produce this use case ... EZtemplates is now a dependency of the MultiJob plugin considering the mentioned integration / EZtempaltes support. I also upgraded the version of EZtemplates to the latest version and still couldn't re-produce. Could you please send me the following info: 1. Jenkins core version 2. EZtemplates plugin version Anything else you may think is relevant so I can double check.
            hagzag hagzag made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            doy Jesse Luehrs added a comment - - edited

            I'm also running into this issue, with Jenkins version 1.651.3, jenkins-multijob-plugin version 1.22, and ez-templates version 1.2.0. The multijob plugin initially failed to load after upgrading, since it was throwing errors about the ez-templates plugin not being installed. After installing the ez-templates plugin, most things seem to work except that visiting a job page for a multijob project shows this stack trace

            Caused by: java.lang.NoClassDefFoundError: com/joelj/jenkins/eztemplates/InheritenceStep/EzTemplateBuilder
            	at com.tikal.jenkins.plugins.multijob.views.MultiJobView.addMultiProject(MultiJobView.java:127)
            	at com.tikal.jenkins.plugins.multijob.views.MultiJobView.addTopLevelProject(MultiJobView.java:112)
            	at com.tikal.jenkins.plugins.multijob.views.MultiJobView.getRootItem(MultiJobView.java:106)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            	at java.lang.reflect.Method.invoke(Method.java:606)
            	at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
            	at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104)
            	at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)
            	at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57)
            	at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
            	at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)
            	at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74)
            	at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:58)
            	at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
            	at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
            	at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
            	at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147)
            	at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
            	... 83 more
            

            There are no errors in the Jenkins log file.

            doy Jesse Luehrs added a comment - - edited I'm also running into this issue, with Jenkins version 1.651.3, jenkins-multijob-plugin version 1.22, and ez-templates version 1.2.0. The multijob plugin initially failed to load after upgrading, since it was throwing errors about the ez-templates plugin not being installed. After installing the ez-templates plugin, most things seem to work except that visiting a job page for a multijob project shows this stack trace Caused by: java.lang.NoClassDefFoundError: com/joelj/jenkins/eztemplates/InheritenceStep/EzTemplateBuilder at com.tikal.jenkins.plugins.multijob.views.MultiJobView.addMultiProject(MultiJobView.java:127) at com.tikal.jenkins.plugins.multijob.views.MultiJobView.addTopLevelProject(MultiJobView.java:112) at com.tikal.jenkins.plugins.multijob.views.MultiJobView.getRootItem(MultiJobView.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258) at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104) at org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83) at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) at org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51) at org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80) at hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:58) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95) at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:147) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) ... 83 more There are no errors in the Jenkins log file.
            brantone Brantone added a comment -

            Seconded. Definitely more than just a "minor"

            brantone Brantone added a comment - Seconded. Definitely more than just a "minor"
            brantone Brantone added a comment -

            The line in https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/views/MultiJobView.java#L127 is the culprit and yet odd since it hasn't changed in a long time (and l've been using 1.21 for a while), so something changes in 1.22 to cause this dependency oddity ... probably have to change "instanceof EzTemplateBuilder" since builder doesn't exist, or even remove complete??

            brantone Brantone added a comment - The line in https://github.com/jenkinsci/tikal-multijob-plugin/blob/master/src/main/java/com/tikal/jenkins/plugins/multijob/views/MultiJobView.java#L127 is the culprit and yet odd since it hasn't changed in a long time (and l've been using 1.21 for a while), so something changes in 1.22 to cause this dependency oddity ... probably have to change "instanceof EzTemplateBuilder" since builder doesn't exist, or even remove complete??

            hagzag As indicated in Environment above I have EZ Templates installed at version 1.2.0. I run Jenkins version 2.16.
            It looks like the EZ Templates plugin got installed automatically by upgrading the Multijob Plug-In to 1.22.

            Actually ez-templates should be an optional dependency since the code using it isn't useful if there are no jobs that use ez-templates and thus pulling it in unconditionally bloats my Jenkins installation for no reason.

            cobexer Ing. Christoph Obexer added a comment - hagzag As indicated in Environment above I have EZ Templates installed at version 1.2.0. I run Jenkins version 2.16. It looks like the EZ Templates plugin got installed automatically by upgrading the Multijob Plug-In to 1.22. Actually ez-templates should be an optional dependency since the code using it isn't useful if there are no jobs that use ez-templates and thus pulling it in unconditionally bloats my Jenkins installation for no reason.
            hagzag hagzag added a comment -

            IMO I cannot make it optional if I have an import statement ... but I will give it a try I know all I need to do is add the optional tag to the dependency in the pom ...

            hagzag hagzag added a comment - IMO I cannot make it optional if I have an import statement ... but I will give it a try I know all I need to do is add the optional tag to the dependency in the pom ...
            brantone Brantone added a comment -

            I had run into same thing on a different plugin ... workaround (albeit a bit hacky) was to string compare the class name instead of "instanceof" ... but in this situation, I can't help but wonder what that condition is catching since no "EzTemplateBuilder" can be found.

            brantone Brantone added a comment - I had run into same thing on a different plugin ... workaround (albeit a bit hacky) was to string compare the class name instead of "instanceof" ... but in this situation, I can't help but wonder what that condition is catching since no "EzTemplateBuilder" can be found.
            cobexer Ing. Christoph Obexer added a comment - - edited

            hagzag Try adding a Conditional Step single to a MultiJob job instead of a MultiJob Phase(Looking at the code linked above and my configuration this should trigger the exception). Also my Jenkins version might have been the 2.7.2 LTS at the time of the Exception. I couldn't figure out exactly when the upgrade happened so I'm not sure which of the two verisons was actually in use at the time.

            According to https://wiki.jenkins-ci.org/display/JENKINS/Tips+for+optional+dependencies Your code could have the dependency as optional and use code like:

            if (null != Jenkins.instance.getPlugin("ez-templates") && builder instanceof EzTemplateBuilder) {
              // ...
            }
            
            cobexer Ing. Christoph Obexer added a comment - - edited hagzag Try adding a Conditional Step single to a MultiJob job instead of a MultiJob Phase(Looking at the code linked above and my configuration this should trigger the exception). Also my Jenkins version might have been the 2.7.2 LTS at the time of the Exception. I couldn't figure out exactly when the upgrade happened so I'm not sure which of the two verisons was actually in use at the time. According to https://wiki.jenkins-ci.org/display/JENKINS/Tips+for+optional+dependencies Your code could have the dependency as optional and use code like: if ( null != Jenkins.instance.getPlugin( "ez-templates" ) && builder instanceof EzTemplateBuilder) { // ... }

            I can also reproduce the crash locally if I use mvn hpi:run with current master (346ea0e507bf351dc39059c343f021f997843491) as soon as I update the EZTemplates plugin to version 1.2.0 the multijob view crashes with the above mentioned exception.

            Also I can't build using ez-templates 1.2.0 because it is not in http://repo.jenkins-ci.org/public/com/joelj/jenkins/ez-templates/.

            I'm not sure where this plugin really comes from because the versions from GitHub https://github.com/jenkinsci/ez-templates-plugin and the maven repository above have almost nothing in common...

            cobexer Ing. Christoph Obexer added a comment - I can also reproduce the crash locally if I use mvn hpi:run with current master (346ea0e507bf351dc39059c343f021f997843491) as soon as I update the EZTemplates plugin to version 1.2.0 the multijob view crashes with the above mentioned exception. Also I can't build using ez-templates 1.2.0 because it is not in http://repo.jenkins-ci.org/public/com/joelj/jenkins/ez-templates/ . I'm not sure where this plugin really comes from because the versions from GitHub https://github.com/jenkinsci/ez-templates-plugin and the maven repository above have almost nothing in common...
            gilbr Gil Br made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            mikedougherty Mike Dougherty added a comment - - edited

            cobexer FYI the null check for the ez-templates plugin doesn't work, as the plugin is actually installed. But since the class is still not present, the NoClassDefFoundError still occurs.

            Patiently awaiting an official fix, but for now I'm running a custom build with the offending codeblock removed (we don't make use of ez-templates).

            If anyone wants to use my change, it can be found here: https://github.com/jenkinsci/tikal-multijob-plugin/compare/master...mikedougherty:fix-ez-template-view (without warranty or support, etc etc)

            mikedougherty Mike Dougherty added a comment - - edited cobexer FYI the null check for the ez-templates plugin doesn't work, as the plugin is actually installed. But since the class is still not present, the NoClassDefFoundError still occurs. Patiently awaiting an official fix, but for now I'm running a custom build with the offending codeblock removed (we don't make use of ez-templates). If anyone wants to use my change, it can be found here: https://github.com/jenkinsci/tikal-multijob-plugin/compare/master...mikedougherty:fix-ez-template-view (without warranty or support, etc etc)
            hagzag hagzag added a comment -

            @itaior I think we should drop the support of this plugin unless we can pin it down to 1.20 (which I understand can't be done considering it isn't hosted properly ...). If there are no comments from the EZ-template maintainers I guess we should do this.

            hagzag hagzag added a comment - @itaior I think we should drop the support of this plugin unless we can pin it down to 1.20 (which I understand can't be done considering it isn't hosted properly ...). If there are no comments from the EZ-template maintainers I guess we should do this.
            cobexer Ing. Christoph Obexer made changes -
            Component/s ez-templates-plugin [ 20651 ]

            drekbour Maybe you could answer the question about why the ez-templates plugin version 1.2.0 is missing from repo.jenkinsci.org or why it changed in an incompatible way?

            mikedougherty The null check is supposed to allow the ez-templates plugin to be an optional dependency. If it is installed it needs to be compatible of course. I'm sorry this wasn't stated more clearly in my comment above.

            cobexer Ing. Christoph Obexer added a comment - drekbour Maybe you could answer the question about why the ez-templates plugin version 1.2.0 is missing from repo.jenkinsci.org or why it changed in an incompatible way? mikedougherty The null check is supposed to allow the ez-templates plugin to be an optional dependency. If it is installed it needs to be compatible of course. I'm sorry this wasn't stated more clearly in my comment above.
            drekbour Marc Carter added a comment - - edited

            Hi all. Erstwhile ez-templates plugin maintainer here.
            This is very poor situation indeed. InheritanceStep has never been a class of this plugin - the history is there for you to review and I share your frustration. At some point prior to ez-templates migrating into official jenkins repo, someone uploaded an unofficial hpi from their private fork. Presumably, this is the code you've been using.
            https://groups.google.com/d/msg/jenkinsci-dev/NVLHCFegfYw/X_5u3Us_CgAJ

            I rejected that change as complicating ez internals too much considering I'm (ok very slowly) intending a refactoring that will make it much more powerful.

            Please re-evaluate and drop support if required (but do create a new jira on both Components to add it back!)

            update: confirmed http://repo.jenkins-ci.org/public/com/joelj/jenkins/ez-templates/ needs to be expunged - that's not code that made it past a PR. As per standard - when onboarded it became ez-templates_-plugin_ and I never noticed this other stuff camping on the previous name. I'll leave it a month or two before asking for it to be removed.

            drekbour Marc Carter added a comment - - edited Hi all. Erstwhile ez-templates plugin maintainer here. This is very poor situation indeed. InheritanceStep has never been a class of this plugin - the history is there for you to review and I share your frustration. At some point prior to ez-templates migrating into official jenkins repo, someone uploaded an unofficial hpi from their private fork. Presumably, this is the code you've been using. https://groups.google.com/d/msg/jenkinsci-dev/NVLHCFegfYw/X_5u3Us_CgAJ I rejected that change as complicating ez internals too much considering I'm (ok very slowly) intending a refactoring that will make it much more powerful. Please re-evaluate and drop support if required (but do create a new jira on both Components to add it back!) update : confirmed http://repo.jenkins-ci.org/public/com/joelj/jenkins/ez-templates/ needs to be expunged - that's not code that made it past a PR. As per standard - when onboarded it became ez-templates_-plugin_ and I never noticed this other stuff camping on the previous name. I'll leave it a month or two before asking for it to be removed.
            hagzag hagzag added a comment -

            drekbour Can't you suggest a PR to fix this issue ?
            I am personally on vacation but I know there are some users out there with a broken Multijob experience something I do not want and can instruct my team to just rollout this change and release 1.23 ...

            hagzag hagzag added a comment - drekbour Can't you suggest a PR to fix this issue ? I am personally on vacation but I know there are some users out there with a broken Multijob experience something I do not want and can instruct my team to just rollout this change and release 1.23 ...
            drekbour Marc Carter added a comment -

            Afraid I'm also on vcay so you're getting coffee-breaks only. Brief inspection shows very little of the change is in the multijob PR and most of it is in the lost ez PR.

            There is no tactical choice but to revert https://github.com/jenkinsci/tikal-multijob-plugin/pull/75/

            drekbour Marc Carter added a comment - Afraid I'm also on vcay so you're getting coffee-breaks only. Brief inspection shows very little of the change is in the multijob PR and most of it is in the lost ez PR. There is no tactical choice but to revert https://github.com/jenkinsci/tikal-multijob-plugin/pull/75/
            hagzag hagzag added a comment -

            Won't fix this considering the eztemplates maintainer isn't sure about the future of the plugin and doesn't have time to fix it - we can re0open this when the time come.
            I already issued the revert on master and it is pending for 1.23 release

            hagzag hagzag added a comment - Won't fix this considering the eztemplates maintainer isn't sure about the future of the plugin and doesn't have time to fix it - we can re0open this when the time come. I already issued the revert on master and it is pending for 1.23 release
            hagzag hagzag made changes -
            Resolution Won't Fix [ 2 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            cobexer Ing. Christoph Obexer made changes -
            Link This issue duplicates JENKINS-37709 [ JENKINS-37709 ]
            cobexer Ing. Christoph Obexer made changes -
            Link This issue duplicates JENKINS-37453 [ JENKINS-37453 ]
            doy Jesse Luehrs added a comment -

            Is there a timeline on the 1.23 release? I'd like to be able to upgrade for some of the other changes, but this is still blocking.

            doy Jesse Luehrs added a comment - Is there a timeline on the 1.23 release? I'd like to be able to upgrade for some of the other changes, but this is still blocking.

            Yeah we really need this update too, do we know when this plugin will be available and released?

            lorelei Lorelei McCollum added a comment - Yeah we really need this update too, do we know when this plugin will be available and released?
            larsrh Lars Hupel added a comment -

            hagzag A new release would be much appreciated. It's affecting us too.

            larsrh Lars Hupel added a comment - hagzag A new release would be much appreciated. It's affecting us too.
            larsrh Lars Hupel added a comment -

            By the way, I deployed an updated version from Git (based on ae30e9b), and the error disappears.

            larsrh Lars Hupel added a comment - By the way, I deployed an updated version from Git (based on ae30e9b), and the error disappears.
            fnaum Federico Naum added a comment -

            Thanks larsrh building from ae30e9b works fine for me as well

            fnaum Federico Naum added a comment - Thanks larsrh building from ae30e9b works fine for me as well
            krische Brian Krische added a comment -

            Still no ETA on a 1.23 release?

            krische Brian Krische added a comment - Still no ETA on a 1.23 release?

            Running into the same issue when using latest LTS (2.7.4) plus "stable" plugins. Rolling multijob back to 1.21 fixes it, but I think it should be respun because otherwise every multijob user that updates plugins will see this.

            schniedergers Klaus Schniedergers added a comment - Running into the same issue when using latest LTS (2.7.4) plus "stable" plugins. Rolling multijob back to 1.21 fixes it, but I think it should be respun because otherwise every multijob user that updates plugins will see this.
            contewit Brenden Conte added a comment -

            Second a respin please.

            contewit Brenden Conte added a comment - Second a respin please.
            sgoetz Sebastian Götz added a comment - - edited

            Same problem for me here using LTS 2.19.1 with MultiJob plugin 1.22.
            Me too asking for a release plan for 1.23

            Update: Downgrade to 1.21 worked for me.

            sgoetz Sebastian Götz added a comment - - edited Same problem for me here using LTS 2.19.1 with MultiJob plugin 1.22. Me too asking for a release plan for 1.23 Update: Downgrade to 1.21 worked for me.
            hagzag hagzag made changes -
            Status Resolved [ 5 ] In Review [ 10005 ]
            hagzag hagzag added a comment -

            Rolled back ez-template plugin support until maintainer helps out ...

            hagzag hagzag added a comment - Rolled back ez-template plugin support until maintainer helps out ...
            hagzag hagzag made changes -
            Resolution Won't Fix [ 2 ] Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            hagzag hagzag made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            cobexer Ing. Christoph Obexer made changes -
            Link This issue is duplicated by JENKINS-38411 [ JENKINS-38411 ]
            drekbour Marc Carter made changes -
            Link This issue is duplicated by JENKINS-38053 [ JENKINS-38053 ]
            drekbour Marc Carter made changes -
            Link This issue is duplicated by JENKINS-42253 [ JENKINS-42253 ]

            People

              hagzag hagzag
              cobexer Ing. Christoph Obexer
              Votes:
              4 Vote for this issue
              Watchers:
              30 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: