I have a problem using artifactory and jenkins. See the error log below.
My version jenkins : 1.638
My version of artifactory : 3.9.2
Artifactory is working ok and also installed plugin in jenkins and configured. All seems to work ok but when I want to build a project I have the error below.
ERROR: Processing failed due to a bug in the code.
Please report this to jenkinsci-users#googlegroups.com
**java.lang.RuntimeException: java.lang.NullPointerException
at org.jfrog.hudson.maven3.extractor.MavenExtractorEnvironment.buildEnvVars(MavenExtractorEnvironment.java:136)**
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:947)
at hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56)
at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:165)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:620)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1738)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.lang.NullPointerException
at org.jfrog.hudson.util.ExtractorUtils.addBuilderInfoArguments(ExtractorUtils.java:157)
at org.jfrog.hudson.maven3.extractor.MavenExtractorEnvironment.buildEnvVars(MavenExtractorEnvironment.java:132)
... 9 more
project=hudson.maven.MavenModuleSet#d90cf1[messenger]
project.getModules()=[hudson.maven.MavenModule#3993ad[messenger/com.jdb.software:messenger][messenger/com.jdb.software:messenger][relativePath:]]
project.getRootModule()=hudson.maven.MavenModule#3993ad[messenger/com.jdb.software:messenger][messenger/com.jdb.software:messenger][relativePath:]
FATAL: java.lang.NullPointerException
This is actually a bug (since version 2.4.0).
There is a Jira issue for this (which I guess you opened).
I attached a URL to a snapshot version built on top of the last release (2.4.4) which also contains a fix for you issue.
If you have any issues with the fix or for any feedback you can use the Jira to communicate it.
BTW: There is a work around that you can use - just configure an Artifactory publish task and everything will work.
Related
I have created a Free style project which just check out the code from SVN. It was all working fine but suddenly I have start getting this error:
java.lang.NoClassDefFoundError: org/jenkinsci/plugins/workflow/job/WorkflowRun
at org.jenkinsci.plugins.workflow.job.WorkflowJob$SCMListenerImpl.onCheckout(WorkflowJob.java:621)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Finished: FAILURE
Can you please help me here how do I resolve this.
The issue got resolved after upgrading Jenkins to the latest version i.e. 2.89 along with latest plugins. The plugins were installed via Plugin Manager feature available in Jenkins.
Java 1.8
Jenkins 2.89
Trying to install "Build Pipeline Plugin v1.5.6" fails due to:
hudson.util.IOException2: Failed to download from
http://updates.jenkins-ci.org/download/plugins/jquery/1.11.2-0/jquery.hpi
(redirected to:
http://ftp.tsukuba.wide.ad.jp/software/jenkins/plugins/jquery/1.11.2-0/jquery.hpi)
at
hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1172)
at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1678)
at
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1876)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1652)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266) at
hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Thread.java:745) Caused by:
java.io.IOException: Inconsistent file length: expected 3003464 but
only got 872533 at
hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:1155)
... 7 more
The jQuery plug-in is nowhere to be found as part of the plug-in installation...
Googling for a workaround did not give fruitful results. Maybe the Jenkins community knows how to workaround this?
Looks like downloading the plug-in's .hpi file from the FTP site and uploading it via the Jenkins UI followed by restarting Jenkins resolved the issue...
It is unclear why the plug-in installation fails otherwise.
We have Sonar and Jenkins located on the same machine, and Sonar analysis is run as Jenkins job post step. Jenkins jobs are built with Maven 3.0.5.
Everything was fine until we updated Sonar from 4.5.x to 5.1.2 yesterday.
After update sonar step failed with exception:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project TestApplication: Can not execute Sonar
Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.sonar:sonar-maven3-plugin:5.1.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.sonar:sonar-maven3-plugin:jar:5.1.2
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.codehaus.sonar:sonar-maven3-plugin:jar:5.1.2
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure to find org.codehaus.sonar:sonar-maven3-plugin:pom:5.1.2 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
We figured out that there is actually 5.1 version of org.codehaus.sonar:sonar-maven3-plugin, but no 5.1.2 in maven repo.
Fix:
We managed to fix it with forcing org.codehaus.mojo:sonar-maven-plugin version to 2.6 through in our pom file, as advised on official Analyzing with Sonar doc
But since we have dozens of projects, there should be better solution rather than changing every single project's pom files
Ok, simple solution found:
In the maven repository (.m2) it was cached that latest version of org.codehaus.mojo:sonar-maven-plugin is 2.0, even though the latest one is 2.6. (in file .m2/repository/org/codehaus/mojo/sonar-maven-plugin/maven-metadata-central.xml)
The old version differs a lot from the new one in the way it works (see Which sonar-maven-plugin version to use?)
We removed .m2/repository/org/codehaus/mojo/sonar-maven-plugin directory, so that newer version is downloaded.
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 jenkinsci-users#googlegroups.com
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)
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)
Jenkins:http://jenkins-ci.org/changelog
What's new in 1.426 (2011/08/15)
Auto Install JDK asks for Oracle account, but the link goes 404.
(issue 10556)
Record and display who aborted builds.
Added API token support. (issue 9363)
Maven Plugin can use settings and global settings files provided by
the config provider plugin Fixed background of title image (issue
9571)
when i run mvn project,failed.
13:10:22 Waiting for Jenkins to finish collecting data
13:10:23 channel stopped
13:10:25 FATAL: null
13:10:27 java.lang.NullPointerException
13:10:27 at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:833)
13:10:27 at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:448)
13:10:27 at hudson.model.Run.run(Run.java:1376)
13:10:27 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:479)
13:10:27 at hudson.model.ResourceController.execute(ResourceController.java:88)
13:10:27 at hudson.model.Executor.run(Executor.java:230)
i rollback 1.424,it work.
This also happened in our environment after upgrading to 1.426. (Windows running a multi-slave-setup).
The issue is now registered in the Jenkins issue tracker:
JENKINS-10715
Finishing with a Null Pointer Exception after a successful build., and the duplicate
JENKINS-10755
NPE after successful project build with maven