Chinaunix首页 | 论坛 | 博客
  • 博客访问: 475489
  • 博文数量: 122
  • 博客积分: 1403
  • 博客等级: 中尉
  • 技术积分: 1668
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-11 13:31
文章分类

全部博文(122)

文章存档

2018年(5)

2017年(12)

2014年(15)

2013年(33)

2012年(4)

2011年(53)

分类: 敏捷开发

2013-08-19 19:06:17

Jenkins部署构建工程到tomcat 7错误,错误日志如下:

 

ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/usr/test/target/test.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:904)at hudson.FilePath.act(FilePath.java:877)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.model.Build$BuildExecution.post2(Build.java:183)at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)at hudson.model.Run.execute(Run.java:1600)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.io.IOException: Server returned HTTP response code: 403 for URL: (HttpURLConnection.java:1625)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
java.io.IOException: Server returned HTTP response code: 403 for URL: (HttpURLConnection.java:1625)
	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)
	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:904)
	at hudson.FilePath.act(FilePath.java:877)
	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.model.Build$BuildExecution.post2(Build.java:183)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
	at hudson.model.Run.execute(Run.java:1600)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:237)
Finished: FAILURE

 

 

这个问题是因为对于tomcat 7的user的权限定义引起的,可查看, 摘录如下

 

manager-gui — Access to the HTML interface. 

manager-status — Access to the "Server Status" page only. 

manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page. 

manager-jmx — Access to JMX proxy interface and to the "Server Status" page.

 

必须把部署用户的权限定义为“manager-script”,才可以成功部署。

阅读(8218) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~