gpt4 book ai didi

tomcat - 使用 jenkins 将 war 文件重新部署到 tomcat 服务器失败

转载 作者:行者123 更新时间:2023-11-28 22:27:36 29 4
gpt4 key购买 nike

第一次成功将 War 文件部署到 tomcat 服务器(如果在 webapps 文件夹中找不到 war 文件)。再次构建 war 文件并在第二次部署时失败并出现以下错误。

|Compiling 1 GSP file for package [jasper]
..
|Building WAR file
.............................................................................................
|Done creating WAR target\ROOT.war
Deploying G:\practice\jenkins\jobs\Grails-Jenkins\workspace\ccsystem\target\ROOT.war to container Tomcat 7.x Remote
[G:\practice\jenkins\jobs\Grails-Jenkins\workspace\ccsystem\target\ROOT.war] is not deployed. Doing a fresh deployment.
Deploying [G:\practice\jenkins\jobs\Grails-Jenkins\workspace\ccsystem\target\ROOT.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [G:\practice\jenkins\jobs\Grails-Jenkins\workspace\ccsystem\target\ROOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185)
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:990)
at hudson.FilePath.act(FilePath.java:968)
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:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3192)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3175)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:647)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:538)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102)
... 17 more
java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3192)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3175)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:647)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:538)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:185)
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:990)
at hudson.FilePath.act(FilePath.java:968)
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:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Deploy war/ear to a container' marked build as failure
Sending e-mails to: krishna.vardhireddy@gmail.com
Finished: FAILURE

最佳答案

使用POST BUILD插件(或带有 Exec 命令 的 SSH 插件)。通常我们将类似的脚本放在那里:

sleep 7
rm -rf /home/tomcat_projectName/webapps/api.projectName.com
rm -rf /home/tomcat_projectName/webapps/api.projectName.com.war
cp /home/jenkins/jenkins-data/api.projectName.com.war /home/tomcat_projectName/webapps/api.projectName.com.war
rm -rf /home/jenkins/jenkins-data/api.projectName.com.war
/home/tomcat_projectName/bin/startup.sh

关于tomcat - 使用 jenkins 将 war 文件重新部署到 tomcat 服务器失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35987878/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com