Error while running jenkins build - jenkins

I am getting below error while running my build. The build is triggering other builds also and creating and deploying RPMS.
Artifactory plugin version is 2.10.3
FATAL: org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.setConnectionRetries(Ljava/lang/Integer;)V
java.lang.NoSuchMethodError: org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration.setConnectionRetries(Ljava/lang/Integer;)V
at org.jfrog.hudson.util.ExtractorUtils.setRetryParams(ExtractorUtils.java:400)
at org.jfrog.hudson.util.ExtractorUtils.setPublisherInfo(ExtractorUtils.java:313)
at org.jfrog.hudson.util.ExtractorUtils.getArtifactoryClientConfiguration(ExtractorUtils.java:155)
at org.jfrog.hudson.util.ExtractorUtils.addBuilderInfoArguments(ExtractorUtils.java:141)
at org.jfrog.hudson.maven3.extractor.MavenExtractorEnvironment.buildEnvVars(MavenExtractorEnvironment.java:139)
at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:931)
at hudson.maven.AbstractMavenBuild.getEnvironment(AbstractMavenBuild.java:56)
at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:169)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:635)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)

Please clear Jenkins cache and update
Artifactory-Jenkins-Plugin to the latest version v2.10.4.

Related

unable to deploy war file in tomcat9 using jenkins

I am trying to deploy war file in tomcat but unable to do so. I am using tomcat9. I have configure tomcat9 and its up and active on port 9090 as I am using port 8080 for jenkins. I am running jenkins and tomcat9 in my local Ubuntu 20.04. When I run my jenkins job, I am getting the below logs:
Started by user Pritish
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/deploy-staging
Copied 1 artifact from "package" build number 5
[DeployPublisher][INFO] Attempting to deploy 1 war file(s)
[DeployPublisher][INFO] Deploying /var/lib/jenkins/workspace/deploy-staging/webapp/target/webapp.war to container Tomcat 9.x Remote with context null
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/workspace/deploy-staging/webapp/target/webapp.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:176)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
at hudson.FilePath.act(FilePath.java:1164)
at hudson.FilePath.act(FilePath.java:1147)
at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
at hudson.model.Build$BuildExecution.post2(Build.java:177)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
at hudson.model.Run.execute(Run.java:1932)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.FileNotFoundException: http://localhost:9090/manager/text/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1896)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:577)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:882)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:895)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:161)
... 19 more
java.io.FileNotFoundException: http://localhost:9090/manager/text/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1896)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:577)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:882)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:895)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:161)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
at hudson.FilePath.act(FilePath.java:1164)
at hudson.FilePath.act(FilePath.java:1147)
at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
at hudson.model.Build$BuildExecution.post2(Build.java:177)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
at hudson.model.Run.execute(Run.java:1932)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE
I fixed it. My webapps directory was empty. So, I installed tomcat9-admin and reinstalled tomcat9 by using the command sudo apt install tomcat9 tomcat9-admin. Then I restarted the tomcat service using sudo service tomcat9 restart. Here are my logs in jenkins:
Started by user Pritish
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/deploy-staging
Copied 1 artifact from "package" build number 5
[DeployPublisher][INFO] Attempting to deploy 1 war file(s)
[DeployPublisher][INFO] Deploying /var/lib/jenkins/workspace/deploy-staging/webapp/target/webapp.war to container Tomcat 9.x Remote with context null
[/var/lib/jenkins/workspace/deploy-staging/webapp/target/webapp.war] is not deployed. Doing a fresh deployment.
Deploying [/var/lib/jenkins/workspace/deploy-staging/webapp/target/webapp.war]
Finished: SUCCESS

AutoDeploy Jenkins, Payara

I want an automated deploy to payara server with Jenkins, but I don't know how to achieve this. Could someone please help me?
Maybe I should use docker or any other application to make this job. I used the plugin "deploy war/ear" but this was the error:
C:\Program Files (x86)\Jenkins\workspace\pp1>exit 0
Deploying C:\Program Files (x86)\Jenkins\workspace\pp1\target\despliegue1-1.0-SNAPSHOT.war to container GlassFish 3.x Remote with context
ERROR: Build step failed with exception
org.glassfish.api.admin.InvalidCommandException: V3 cannot process this command at this time, please wait
at com.sun.enterprise.admin.remote.RemoteAdminCommand.fetchCommandModel(RemoteAdminCommand.java:1152)
at com.sun.enterprise.admin.remote.RemoteAdminCommand.getCommandModel(RemoteAdminCommand.java:330)
at com.sun.enterprise.admin.cli.remote.RemoteCommand.prepare(RemoteCommand.java:297)
at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:242)
at com.sun.enterprise.admin.cli.remote.RemoteCommand.executeAndReturnOutput(RemoteCommand.java:389)
at org.glassfish.deployment.client.RemoteDeploymentFacility$RemoteCommandRunner.run(RemoteDeploymentFacility.java:117)
Caused: java.lang.RuntimeException
at org.glassfish.deployment.client.RemoteDeploymentFacility$RemoteCommandRunner.run(RemoteDeploymentFacility.java:121)
at org.glassfish.deployment.client.AbstractDeploymentFacility.listReferencedTargets(AbstractDeploymentFacility.java:704)
Caused: java.lang.RuntimeException: error submitting remote command
at org.glassfish.deployment.client.AbstractDeploymentFacility.listReferencedTargets(AbstractDeploymentFacility.java:735)
at org.glassfish.deployment.client.AbstractDeploymentFacility.listTargets(AbstractDeploymentFacility.java:693)
at org.glassfish.deployapi.SunDeploymentManager.getTargets(SunDeploymentManager.java:169)
Caused: java.lang.IllegalStateException: error submitting remote command
at org.glassfish.deployapi.SunDeploymentManager.getTargets(SunDeploymentManager.java:171)
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.findTargetModule(AbstractJsr88Deployer.java:439)
at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.redeploy(AbstractJsr88Deployer.java:197)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1077)
at hudson.FilePath.act(FilePath.java:1060)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
at hudson.model.Run.execute(Run.java:1840)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

Build run's into error and fails in Jenkins

I am using jenkins for the build but every time i run a build it gives an error and fails?
These are the errors :
FATAL: hudson/tasks/Mailer$UserProperty
java.lang.ClassNotFoundException: hudson.tasks.Mailer$UserProperty
at
jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
at
jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
at
jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused: java.lang.NoClassDefFoundError:
hudson/tasks/Mailer$UserProperty at
org.jenkinsci.plugins.p4.changes.P4ChangeRef.getChangeEntry(P4ChangeRef.java:18)
at
org.jenkinsci.plugins.p4.tasks.CheckoutTask.getChangesFull(CheckoutTask.java:287)
at
org.jenkinsci.plugins.p4.PerforceScm.calculateChanges(PerforceScm.java:535)
at
org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:496)
at hudson.scm.SCM.checkout(SCM.java:504) at
hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
at
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
at
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
at hudson.model.Run.execute(Run.java:1815) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at
hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
Sounds like an out-of-date plugin/Jenkins install.
I would recommend updating Jenkins if you're on an older version (I'm currently running 2.121.2).
After Jenkins is updated, try updating all of your plugins as well.
From the main Jenkins page, click "Manage Jenkins" and then "Manage Plugins" or just navigate to: http://yourjenkins.install/pluginManager/.
Scroll to the bottom of the page, click the link "All" near the word Select. Then click the big blue Update button.
This will probably resolve the issue, if not, you've got a bigger issue.

jenkins deploying .war file to tomcat - TomcatManagerException

Artifacts are being copied, but while deploying it to tomcat, the following exception is being thrown
org.codehaus.cargo.container.ContainerException: Failed to deploy
[/home/sherlock/.jenkins/workspace/My_Staging/MyApi.war] at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:106)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
at hudson.FilePath.act(FilePath.java:1047)
at hudson.FilePath.act(FilePath.java:1025)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
at hudson.model.Build$BuildExecution.post2(Build.java:186)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1819)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by:
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
The Tomcat Manager responded "FAIL - Deployed application at context
path [/MyGubbiApi] but context failed to start " instead of the
expected "OK" message
The error indicates your war was deployed, but failed to start. Check your tomcat logs for more detailed errors.
Also to verify this issue is not related to your Jenkins job configuration, could you verify whether manually deploying the war works? If manually deploying works, then the issue is likely in the Jenkins job configuration. If manual deployment fails (with same error), the problem can be found in the tomcat logs.

JiraTestResultReporter.JiraReporter aborted due to exception error in Jenkins

I configured JIRA plugin with Jenkins, I'm getting this error after build get completed. Could anyone explain how can I fix this issue with explanation.
Jenkins ver. 1.580
JIRA plugin 1.39
JiraTestResultReporter plugin 1.0.4
ERROR: Publisher JiraTestResultReporter.JiraReporter aborted due to exception
java.lang.NoSuchMethodError: hudson.model.AbstractBuild.getTestResultAction()Lhudson/tasks/test/AbstractTestResultAction;
at JiraTestResultReporter.JiraReporter.perform(JiraReporter.java:105)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
at hudson.model.Run.execute(Run.java:1770)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
This is a known issue: https://issues.jenkins-ci.org/browse/JENKINS-25140
The bug itself was fixed a long time ago in the GitHub repository, but a change has not yet been released.
Once a newer version than 1.0.4 has been released, this should be resolved.

Resources