user1413969
user1413969

Reputation: 1301

NullPointerException in Jenkins

I'm currently reading the book 'Jenkins Continuous Integration Cookbook', and I came across this error after building a project on Jenkins:

ERROR: Processing failed due to a bug in the code. Please report this to [email protected]

java.lang.NullPointerException
    at java.io.File.<init>(File.java:239)
    at hudson.maven.MavenVersionCallable.call(MavenVersionCallable.java:58)
    at hudson.maven.MavenVersionCallable.call(MavenVersionCallable.java:41)
    at hudson.FilePath.act(FilePath.java:1001)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:604)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:567)
    at hudson.model.Run.execute(Run.java:1604)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:506)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:246)
project=hudson.maven.MavenModuleSet@68f55ff2[A]
project.getModules()=[]
project.getRootModule()=null

I'm confused why I'm getting this, since my Java code is all autogenerated via Maven, and my tests in HTML format. I was able to successfully build the code using maven, before placing a directory with /src and pom.xml as it's children onto bitbucket.

Any ideas why this error is showing? Any advice will be appreciated.

Adding the rest of the error logs below (couldn't before because I was getting formatting errors).

FATAL: null
java.lang.NullPointerException
        at java.io.File.<init>(File.java:239)
    at hudson.maven.MavenVersionCallable.call(MavenVersionCallable.java:58)
    at hudson.maven.MavenVersionCallable.call(MavenVersionCallable.java:41)
    at hudson.FilePath.act(FilePath.java:1001)
    at     hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:604)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:567)
at hudson.model.Run.execute(Run.java:1604)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:506)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:246)

Upvotes: 4

Views: 18779

Answers (1)

ben75
ben75

Reputation: 28736

According a similar bug report (but not exactly the same) I guess that your problem may be caused by a wrong configuration in Jenkins.

I suggest you to check the MAVEN_HOME used by Jenkins (i.e. check that it is really a MAVEN_HOME directory and is the correct maven version)

Upvotes: 1

Related Questions