Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing token-macro results in failed to instantiate DockerBuilderPublisher #463

Closed
tgross opened this issue Dec 1, 2016 · 4 comments
Closed

Comments

@tgross
Copy link

tgross commented Dec 1, 2016

The token-macro dependency is marked as optional but I'm getting the stack trace below when I start up Jenkins (2.19.3). After adding token-macro, the error goes away but the problem isn't documented anywhere on https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin, nor is what makes the optional component optional explained.

Dec 01, 2016 7:28:51 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate Key[type=com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$DescriptorImpl, annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, java.lang.NoClassDefFoundError: org/jenkinsci/plugins/tokenmacro/MacroEvaluationException
  at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$DescriptorImpl.<init>(DockerBuilderPublisher.java:384)

1 error
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
        at com.google.inject.Scopes$1$1.get(Scopes.java:65)
        at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
        at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
        at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:1005)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1051)
        at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:1001)
        at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:386)
        at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:377)
        at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:478)
        at hudson.ExtensionList.load(ExtensionList.java:349)
        at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
        at hudson.ExtensionList.iterator(ExtensionList.java:156)
        at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1443)
        at hudson.plugins.git.GitSCM.onLoaded(GitSCM.java:1754)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
        at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
        at jenkins.model.Jenkins$7.runTask(Jenkins.java:1038)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/tokenmacro/MacroEvaluationException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at hudson.model.Descriptor.<init>(Descriptor.java:287)
        at hudson.tasks.BuildStepDescriptor.<init>(BuildStepDescriptor.java:56)
        at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$DescriptorImpl.<init>(DockerBuilderPublisher.java:384)
        at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher$DescriptorImpl$$FastClassByGuice$$fbd60072.newInstance(<generated>)
        at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
        at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
        at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
        at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
        at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1058)
        at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
        ... 27 more
Caused by: java.lang.ClassNotFoundException: org.jenkinsci.plugins.tokenmacro.MacroEvaluationException
        at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1373)
        at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
        at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 44 more

Installed plugins without adding token-macro are as follows:

credentials:2.1.10
display-url-api:0.5
docker-plugin:0.16.2
durable-task:1.12
git-client:2.1.0
git:3.0.1
junit:1.19
mailer:1.18
matrix-project:1.7.1
promoted-builds:2.27
scm-api:1.3
script-security:1.24
ssh-credentials:1.12
ssh-slaves:1.11
structs:1.5
workflow-scm-step:2.3
workflow-step-api:2.5
@valter-silva-au
Copy link

I had the same issue and your suggestion worked for me, just installing the plugin token-macro and restarting jenkins was enough. Thanks @tgross !

@jm-ds
Copy link

jm-ds commented Feb 9, 2024

Can't install token-macro because it depends on json-path-api, which there seems to be no resolution for and as a result numerous plugins fail.
image
From the admin home screen, there's an option to correct, which does nothing.
image

@jm-ds
Copy link

jm-ds commented Feb 9, 2024

I fixed my issue by manually installing json-path-api plugin from here: https://plugins.jenkins.io/json-path-api/releases/ Then I restarted Jenkins.

@MarkEWaite
Copy link
Contributor

@jm-ds can you further explain what you mean when you say:

Can't install token-macro because it depends on json-path-api, which there seems to be no resolution

That version of the plugin is definitely available for download, as shown by the mirrorlist page at https://get.jenkins.io/plugins/json-path-api/2.8.0-5.v07cb_a_1ca_738c/json-path-api.hpi?mirrorlist . That version was released in December 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants