Jenkins tomcat7 deploying error - maven

I have a jenkins job named 'SampleMavenDeploy1' which copies artifacts(war file,pom.xml) from upstream project('SampleMavenBuild1') successfully to this project.
I have following configuration for this project:
"
Build Steps:
Copy artifacts from another project
Project Name:SampleMavenBuild1
Post-build Actions:
War/Ear files:MavenWebAppV14/target/*.war
Context Path:webapps
Containers:
Tomcat7.x
Manager username:tomcat
Manager Password:tomcat
Tomcat Url:http://localhost:8080/manager/text
"
The build of SampleMavenBuild1(make war file of a maven project) has succeeded. In workspace of this job (SampleMavenDeploy1), there is war file (MavenWebAppV14/target/MavenWebAppV14.war). I have also configured tomcat-users.xml to add user of username 'tomcat' , password 'tomcat' and roles as 'manager-gui' and 'manager-script' .
I am facing following errors in a jenkins build of a job. This job is designed for deploying war file on tomcat7 via CI server. I have also 'deploy to tomcat' plugin installed in jenkins.
Started by user vikas
Building in workspace C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace
Copied 2 artifacts from "SampleMavenBuild1" build number 4
Deploying C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war to container Tomcat 7.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:189)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:918)
at hudson.FilePath.act(FilePath.java:896)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
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)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unknown command /manager/text/list
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
... 16 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unknown command /manager/text/list
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:918)
at hudson.FilePath.act(FilePath.java:896)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
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)
Finished: FAILURE
Anyone who can figure out is most welcomed .
Thanks in advance!!!

You need to give permissions to the text-manager to be able to deploy.
Just go to tomcat-users.xml and add this:
<user username="tomcat" password="password" roles="manager-script"/>
Or just give the manager-script permission to your existing tomcat-manager user

You need to set the base URL to localhost:8080/ in the deploy URL, not the manager URL which is localhost:8080/manager/text (which is what happened in my case).

I have the same problem as you. But I had the tomcat users refresh like the first answer of this question and the problem still persists on Jenkins.
When I tried to connect to tomcat admin zone using my navigator, tomcat didn't display the page to me, because the tomcat-admin package was not installed. So I've installed the tomcat7-admin package and restarted tomcat :
sudo apt-get install tomcat7-admin
sudo service tomcat7 restart
Then the problem was fixed. It was because Jenkins couldn't connect with the program. So easy!

All you have to do is add the users and and assign the manager-gui (for GUI access) and manager-script (for access like Jenkins deployment ). Also, make sure to edit the file /webapps/manager/META-INF/context.xml, either to comment out valve or define appropriate reg ex for allow attribute

If it shows a connection error or fails to load when you deploy jenkins.war file on tomcat, then follow the steps below.
Paste the jenkins folder inside tomcat/webapps.
Restart the tomcat (localhost or ip:8080/jenkins)
Jenkins will load and may asks for password.
To get the jenkins admin password then run
{cat /opt/tomcat/.jenkins/secrets/initialAdminPassword}
If the permission is denied to access the password then
sudo chmod 0777 /opt/tomcat/.jenkins/secrets/initialAdminPassword
or else run ls -a there you will see .jenkins folder.

Related

how to restart teamcity server

I am a beginner to teamcity. Our Teamcity 9 server stopped working after I installed Gradle. I doubt that it was problem with port or something like that. I removed Gradle but Teamcity didn't work. So I tried to restart Teamcity server. We have two teamcity agents. I stopped agents with:
sudo ./runAll.sh stop
and I stopped the server with sudo ./shutdwon.sh
after that I started server again with ./startup.sh and agents with
sudo ./runAll.sh start
Now when I am writing url address in browser I am getting either connection_timout or connection refused But when I am writing url with explicit IP address like 10.31.24.18:8111 then I am getting
My questions:
1- How can I restart Teamcity and agents so that I am getting same agents and project as before restart in TeamCity UI? Or If I am creating Administrator account now after that I should reconfigure all projects or my projects before restart will be there?
2- Why URL with IP-address is working but URL with domain name server name is not working?
You can restart TeamCity right from the UI: Administration > Diagnostics > Server Restart. You will need to have server admin permissions for that.
using command line
cd /opt/teamcity/bin
(sudo) ./teamcity-server.sh stop
(sudo) ./teamcity-server.sh start

Jenkins Deploy Error Tomcat 6.x

Im trying to use jenkins to build and deploy the war file to a tomcat present in different server and im getting the following error -
Deploying /var/lib/jenkins/jobs/ura_Web/workspace/ura-1.0.war to container Tomcat 6.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/jobs/ura_Web/workspace/ura-1.0.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:195)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:64)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:90)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:77)
at hudson.FilePath.act(FilePath.java:905)
at hudson.FilePath.act(FilePath.java:878)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:77)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:47)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:969)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
at hudson.model.Run.execute(Run.java:1618)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247)
Caused by: java.io.FileNotFoundException: http://192.168.2.X/manager/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1401)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:504)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:622)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:635)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:176)
... 16 more </code>
Can anyone tell me what is wrong?
I had exactly this problem just now and still have not solved it. However, I suspect it is happening because of proxy issues.
Is it possible to try setting the manager URL to http://localhost
rather than http://192.168.2.X? This worked for me, showing that the credentials were at least correct and the module functions. When I switch the manager URL back to a remote machine or the FQDN of the local server, it again failed. This indicates to me something proxy related.
The only trouble then is configuring the proxy settings for Jenkins, especially http.nonProxyHosts. If you can do that maybe you'll have more luck than me. I cannot get the Jenkins System Information proxy values to change no matter what I do!
Also manually test from a browser on both the build server and elsewhere your access to the manager URL: http://192.168.2.X/manager/list

What is the default Jenkins password?

I'm using a EC2 server instance. Used the following to install Jenkins:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
but I need to install software on the Jenkins server so in my EC2 instance I did
sudo –s –H –u jenkins
to get into the jenkins server.
Then I tried to do
sudo cabal install quickcheck
but it prompted me for jenkins password.
I've been searching around the internet for 4hrs now and nothing is helping me get administrative privilege in the jenkins server.
So I'm building my project using the following command in shell:
sudo cabal clean
sudo cabal configure
sudo cabal build
sudo cabal install
This is the error I'm getting:
Started by timer
Building in workspace /var/lib/jenkins/jobs/Finance/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Finance/workspace - hudson.remoting.LocalChannel#eea6dc
Using strategy: Default
Last Built Revision: Revision b638e2182dece0ef1a40232b1d75fa3ae5c01a5d (origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from origin
Commencing build of Revision b638e2182dece0ef1a40232b1d75fa3ae5c01a5d (origin/master)
Checking out Revision b638e2182dece0ef1a40232b1d75fa3ae5c01a5d (origin/master)
[workspace] $ /bin/sh -xe /tmp/hudson3500373817395137440.sh
+ sudo cabal clean
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
Build step 'Execute shell' marked build as failure
Sending e-mails to: ***#gmail.com
ERROR: Could not connect to SMTP host: localhost, port: 25
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at javax.mail.Service.connect(Service.java:125)
at javax.mail.Transport.send0(Transport.java:194)
at javax.mail.Transport.send(Transport.java:124)
at hudson.tasks.MailSender.execute(MailSender.java:116)
at hudson.tasks.Mailer.perform(Mailer.java:117)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786)
at hudson.model.Build$BuildExecution.post2(Build.java:183)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:733)
at hudson.model.Run.execute(Run.java:1592)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:286)
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:231)
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)
... 17 more
Finished: FAILURE
Here is how you can fix it:
Stop Jenkins
Go go edit /var/lib/jenkins/config.xml
Change <useSecurity>true</useSecurity> to false
Restart Jenkins: sudo service jenkins restart
Navigate to the Jenkins dashboard to the "Configure Security" option you likely used before. This time, setup security the same as before, BUT set it to allow anyone to do anything, and allow user signup.
Go to www.yoursite.com/securityRealm/addUser and create a user
Then go change allow anyone to do anything to whatever you actually want users to be able to do. In my case, it is allow logged in users to do anything.
If you installed using apt-get in ubuntu 14.04, you will found the default password in /var/lib/jenkins/secrets/initialAdminPassword location.
Before installing jenkins, create a user named jenkins and set password there. Then after installing jenkins you can use the password you created.
With the default Jenkins installation using Homebrew on macOS this will output the initial password for the admin user:
sudo cat /Users/Shared/Jenkins/Home/secrets/initialAdminPassword
jenkins default administrator password is logged in log file in ubuntu
log file is situated in /var/log/jenkins/jenkins.log folder
password will be placed after this,
Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:
After Jenkins is installed just run sudo cat /var/lib/jenkins/secrets/initialAdminPassword.
In the Jenkins login page:
User: admin
Password: the output from the above command
On ubuntu 19.04, the default password are stored in the home directory:
cat ~/.jenkins/secrets/initialAdminPassword
The password is present in the log generated by docker run image as shown in the example below.
Jenkins Docker run log
Additionally you can check the directory /var/jenkins_home/secrets/
Its in the file name initialAdminPassword
You can use
cat /var/jenkins_home/secrets/initialAdminPassword
In my case I was using Jenkins Docker Image and I found the initial admin password using this command:
cat ~/secrets/initialAdminPassword
You can always disable security, then go in and re-enable it with the settings you want.
By default, Jenkins account is created without password and with the login shell as /bin/false.
jenkins:x:496:493:Jenkins Continuous Integration Server:/var/lib/jenkins:/bin/false
Change the shell to /bin/bash and you should be able to login without password by sudo su - jenkins.
Command to change the shell is:
chsh -s /bin/bash jenkin
When you install jenkins on your local machine, the default username is admin and password it gets automatically filled.
I was running Jenkins executing java -jar jenkins.war.
In my case Jenkins wrote webroot in an stdout: webroot: $user.home/.jenkins. So admin secret key was placed in a ~/.jenkins/secrets/initialAdminPassword.
I don't believe that the Jenkins user that is installed via apt has a password. If it does, I have never seen documentation. Based on the commands you entered, I am guessing you are using a Debian distro?
Is there any particular reason you must use the jenkins user to do the install instead of the user which was set up when you created your instance?
When installing Jenkins from AWS Marketplace . . .
"A default user "admin"with the instance-id as password is created to secure the Jenkins instance."
On the AWS Console for EC2, with the instance selected, choose the "Usage Instructions" tab:
"AWS Marketplace Usage Instructions
Latest Versions: 2.19.4.2
A default user "admin"with the instance-id as password is created to secure the Jenkins instance. Once the instance is started, copy the public DNS hostname of the server in the AWS Management Console and enter it in your web browser. The welcome screen allows you to request a trial license, start and evaluation, enter a license key, or connect to your instance to Operations Center. Once the license step is done, your instance is fully functional. We recommend enabling security and backups. You can connect with SSH to the server using the "ubuntu"linux user. The JENKINS_HOME is located under "/var/lib/jenkins". Jenkins listens on the following ports: * HTTP 80: through HAProxy, can be configured to use HTTPS:443 instead * Jenkins SSH 2222: primarily for the CloudBees Git Validated Merge Plugin * Jenkins JNLP 10000: communication from Jenkins agents or Jenkins CLI configured to use JNLP protocol. Not exposed by default on security groups."
Similar to the Ubuntu answer above, the Windows admin default password is stored in {jenkins install dir}\secrets\initialAdminPassword file (default install location would it in C:\Program Files (x86)\Jenkins\secrets\initialAdminPassword )
If you don't create a new user when you installed jenkins, then:
user: admin
pass: go to C:\Program Files (x86)\Jenkins\secrets and open the file initialAdminPassword
I am a Mac OS user & following credential pair worked for me:
Username: admin
Password: admin
For me the best method of retrieving admin pass is by executing cat command inside the running container.
docker exec YOUR_JENKINS_CONTAINER cat /var/jenkins_home/secrets/initialAdminPassword
On Windows it can be found in the file "C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins\secrets\initialAdminPassword"
(I know OP specified EC2 server, but this is now the first result on google when searching Jenkins Password)
Jenkins Default username and password
username: admin
And
password available in the root directory .jenkins\secrets\initialAdminPassword just open the file and copy text and paste into password textbox.
Well,
Even I tried to log in with the admin/password which was failed.
So I created my own user like this.
Go to Jenkins home folder (C:\User.jenkins or you can find this in Jenkins server startup logs)
Go to Config file config.xml
set disableSignup to false false
if at all you want to disable login security
4.set ser security to false. true
For mac users: Just run this command
cat ~/.jenkins/secrets/initialAdminPassword
Initial Password of Jenkins is stored in the following directory
cat /var/lib/jenkins/secrets/initialAdminPassword
There are few steps to follow:
Go to the folder: C:\Users\Manjeet\.jenkins .(here in your case, there can be your system name or your name instead of mine)
Open config.xml file using any text editor.(recommended Notepad++)
Go to Line number seven which is like <useSecurity>true</useSecurity>.
So make it change this from true to false.
Save this file and close the window.
Open Command Prompt and start your Jenkins .
(java -jar jenkins.war --httpPort=8085).
Open browser and search for your localhost at your given port number.
(localhost:8085)
You will see it doesn't ask for username and password anymore. Now you have to delete
that existed user and Add new user for setting new username and password.
Steps to make new Admin:
1.Go to people option which present at second number at left hand side below Dashboard
Click on admin option present in a row and than click on delete.
Go to Dashboard, Click on Manage Jenkins, Click on Configure Global Security.
Check the box of Enable security option.
Check the box of Jenkins own user database option and Uncheck Allow user to sign up present just below of it.
6 . Check Logged-in user can do anything option and Uncheck Allow anonymous read access present just below of it.
Make it Save and it will give you a new form for creating new first user. Fill the details correctly and click on Create First Admin User .(it will automatically made a change on that config.xml file just save it. )

Unable to delete pom.xml in Jenkins under Tomcat/Windows

I've been struggling with an annoying "Jenkins/Tomcat/Windows" problem for a while now without reaching any solution.
I've installed Tomcat version 7.0.25 in a Windows 7 Enterprise machine and Jenkins 1.451 as a webapplication
running under Tomcat. I have just 4 jobs configured right now and all of then are using the "Always chekout a fresh copy" checkout strategy,
so everytime a job runs the content in /jobs//workspace gets deleted. But, there are situations in which the job fails to run because
it is unable to delete the /jobs//workspace/pom.xml file like you can see in this (edited) stacktrace:
Building in workspace C:\.hudson\jobs\<task name>\workspace
Cleaning local Directory .
java.io.IOException: Unable to delete C:\.hudson\jobs\<task name>\workspace\.\pom.xml
at hudson.Util.deleteFile(Util.java:237)
at hudson.Util.deleteRecursive(Util.java:287)
at hudson.Util.deleteContentsRecursive(Util.java:198)
at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:73)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:136)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:780)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:761)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:745)
at hudson.FilePath.act(FilePath.java:788)
at hudson.FilePath.act(FilePath.java:770)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:735)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:677)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465)
at hudson.model.Run.run(Run.java:1409)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:238)
Retrying after 10 seconds
Here you can see Tomcat locking the file as I told:
After some time Jenkins/Tomcat releases the lock on the pom.xml and i can execute the job again without any problem.
Does anyone know how to get around this ? Am i missing something ? Thanks in advance!
I changed to Windows Service installation, and the pom.xml never gets locked anymore.
Seems that this caused by Tomcat that somehow locks the pom.xml, although the build has finished.

Hudson Deploy error on Tomcat 7

I am deploying a WAR file with Hudson 2.1.2 Post Maven Build which fails with this error message. I have the Hudson deploy plugin installed
Deploying
C:\Users\Admin\workspace_astra\astra-maven\target\astra-maven-0.0.1-SNAPSHOT.war
to container Tomcat 7.x Remote The property cargo.tomcat.manager.url
has been deprecated, please use cargo.remote.uri instead. ERROR:
Publisher hudson.plugins.deploy.DeployPublisher aborted due to
exception org.codehaus.cargo.container.ContainerException: Failed to
redeploy
[C:\Users\Dieter\workspace_astra\astra-maven\target\astra-maven-0.0.1-SNAPSHOT.war]
at
org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:191)
at
hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:62)
at
hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:92)
at
hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:75)
at hudson.FilePath.act(FilePath.java:758) at
hudson.FilePath.act(FilePath.java:740) at
hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:75)
at
hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:608)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:584)
at hudson.model.Build$RunnerImpl.post2(Build.java:159) at
hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:553)
at hudson.model.Run.run(Run.java:1391) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at
hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145) Caused by:
java.io.FileNotFoundException: http://localhost:8080/manager/list at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at
org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:507)
at
org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:644)
at
org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:657)
at
org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:172)
... 17 more java.io.FileNotFoundException:
http://localhost:8080/manager/list at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) at
org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:507)
at
org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:644)
at
org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:657)
at
org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:172)
at
hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:62)
at
hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:92)
at
hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:75)
at hudson.FilePath.act(FilePath.java:758) at
hudson.FilePath.act(FilePath.java:740) at
hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:75)
at
hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:45)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:630)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:608)
at
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:584)
at hudson.model.Build$RunnerImpl.post2(Build.java:159) at
hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:553)
at hudson.model.Run.run(Run.java:1391) at
hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at
hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Where do I change this cargo.tomcat.manager.url to cargo.remote.uri within my hudson environment, as this is what is doing the deployment?
I found the answer. There is a bug in the deploy plugin for tomcat 7, so Dominique Righetto kindly rewrote it for everyone an placed it online at Google Docs here https://docs.google.com/#folders/0B7SAopRfWOagNjk5MjBjYTMtODEyYy00ZGRiLTgxZWQtODk1ZDdmN2M4Nzc2.
They speak about it here on the Hudson Wiki
http://wiki.hudson-ci.org/display/HUDSON/Deploy+Plugin
Hope that helps
I had the same problem. I was confused with the problem. There was not manager app running in my tomcat. In your tomcat, inside the webapps folder you should have a folder called manager(this is the one to see manager app). If this is not available "http://localhost:8080/manager/list" this link does not work.
There are two ways to solve this.
1) install new tomcat and make sure this has manager folder.
2) copy the manager folder from some other place, if you have zipped version of tomcat.
once manager folder is copied, restart the server. Before doing restart, you may need to have manager-* roles enabled to the user that you are trying to access the manager app.

Resources