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

Can't build: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/tokenmacro/TokenMacro #94

Closed
marcellodesales opened this issue Sep 18, 2014 · 8 comments

Comments

@marcellodesales
Copy link

Hi there,

I got the following error while trying to build:

Docker Build
FATAL: org/jenkinsci/plugins/tokenmacro/TokenMacro
java.lang.NoClassDefFoundError: org/jenkinsci/plugins/tokenmacro/TokenMacro
    at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.getTag(DockerBuilderPublisher.java:172)
    at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.perform(DockerBuilderPublisher.java:56)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.Build$BuildExecution.build(Build.java:199)
    at hudson.model.Build$BuildExecution.doRun(Build.java:160)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
    at hudson.model.Run.execute(Run.java:1745)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Caused by: java.lang.ClassNotFoundException: org.jenkinsci.plugins.tokenmacro.TokenMacro
    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1375)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 11 more
@thomassuckow
Copy link
Contributor

You need to install the token macro plugin
https://wiki.jenkins-ci.org/display/JENKINS/Token+Macro+Plugin

@GeriGun
Copy link

GeriGun commented Oct 24, 2014

Hello,
After the token plugin installation a new error shows up:
Docker Build

FATAL: null
java.lang.NullPointerException
    at com.nirima.docker.client.DockerClient$Builder.fromClient(DockerClient.java:56)
    at com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.perform(DockerBuilderPublisher.java:60)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.Build$BuildExecution.build(Build.java:199)
    at hudson.model.Build$BuildExecution.doRun(Build.java:160)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
    at hudson.model.Run.execute(Run.java:1754)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)

Any clue one what is missing?

Thx

@magnayn
Copy link
Contributor

magnayn commented Oct 24, 2014

I would guess you're trying to publish an image on a build that wasn't
actually built on docker.

On Fri, Oct 24, 2014 at 12:08 PM, FredGun notifications@github.com wrote:

Hello,
After the token plugin installation a new error shows up:
Docker Build
FATAL: null
java.lang.NullPointerException
at
com.nirima.docker.client.DockerClient$Builder.fromClient(DockerClient.java:56)
at
com.nirima.jenkins.plugins.docker.builder.DockerBuilderPublisher.perform(DockerBuilderPublisher.java:60)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.Build$BuildExecution.build(Build.java:199)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
at hudson.model.Run.execute(Run.java:1754)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)

Any clue one what is missing?

Thx


Reply to this email directly or view it on GitHub
#94 (comment)
.

@GeriGun
Copy link

GeriGun commented Oct 24, 2014

I actually just try to build it and tag it.
No publish configured yet

@magnayn
Copy link
Contributor

magnayn commented Oct 24, 2014

Well, that error comes from the publisher trying to find out which cloud
the build was run on, so it can ask the docker API on that machine to build
the image.

The answer that Jenkins is giving is "null", which implies that build was
not run on docker.

On Fri, Oct 24, 2014 at 12:27 PM, FredGun notifications@github.com wrote:

I actually just try to build it and tag it.
No publish configured yet


Reply to this email directly or view it on GitHub
#94 (comment)
.

@GeriGun
Copy link

GeriGun commented Oct 28, 2014

Issue solved for me, the cloud was miss configured.
Thx

@towe75
Copy link

towe75 commented Oct 28, 2014

FredGun, what exactly was you configuration problem?

I get the same NPE in DockerBuilderPublisher.perform(...).
I'm checking out a Dockerfile from Git and the first buildstep should build a new image.

My environment: jenkins 1.586 on Ubuntu 14.04.

Thx

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

6 participants