gpt4 book ai didi

java - 错误: Build step failed with exception org. codehaus.cargo.container.ContainerException:无法重新部署

转载 作者:太空宇宙 更新时间:2023-11-04 10:49:01 25 4
gpt4 key购买 nike

我在我的 AWS EC2 服务器上安装了 Jenkins,并安装了以下内容:

  • Maven 集成插件
  • 部署到容器插件
  • Slack 通知插件
  • GitHub 集成插件

...可能还有其他一些我不记得了(因为编码)...

我创建新的自由式项目,转到其配置,然后执行以下操作:

  • 常规中,选中GitHub 项目,然后输入项目网址
  • 源代码管理中,选择Git并输入存储库 URL
  • 构建触发器中,选中GITScm 轮询的 GitHub Hook 触发器
  • 在构建中,我添加构建步骤“调用顶级 Maven 目标”,并执行以下操作:
    • 目标中输入全新安装
    • POM 中输入我的项目 pom.xml 的相对路径
  • 在构建后操作中,我执行以下操作:
    • 归档 Artifact : enter image description here
    • 将 war/ear 部署到容器: idk what our business port is but from others, it was 8085

在我尝试构建(工作)代码时,它失败了,我在控制台上得到了这一长串信息:

Started by user Mike Warren
Building in workspace /home/ec2-user/.jenkins/workspace/Project2
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/MikeWarren2014/171106-Project2-SHOULDi.git # timeout=10
Fetching upstream changes from https://github.com/MikeWarren2014/171106-Project2-SHOULDi.git
> git --version # timeout=10
> git fetch --tags --progress https://github.com/MikeWarren2014/171106-Project2-SHOULDi.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision d172c840db59d7aff020787e0b49f3741f57b555 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f d172c840db59d7aff020787e0b49f3741f57b555
Commit message: "gamification finished"
> git rev-list --no-walk d172c840db59d7aff020787e0b49f3741f57b555 # timeout=10
[Project2] $ mvn -f SHOULDi-back/pom.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SHOULDi-back 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ SHOULDi-back ---
[INFO] Deleting /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ SHOULDi-back ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ SHOULDi-back ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 49 source files to /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target/classes
[WARNING] /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/src/main/java/com/zenith/DAO/UserDAO.java: Some input files use or override a deprecated API.
[WARNING] /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/src/main/java/com/zenith/DAO/UserDAO.java: Recompile with -Xlint:deprecation for details.
[WARNING] /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/src/main/java/com/zenith/DAO/UserDAO.java: Some input files use unchecked or unsafe operations.
[WARNING] /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/src/main/java/com/zenith/DAO/UserDAO.java: Recompile with -Xlint:unchecked for details.
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ SHOULDi-back ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ SHOULDi-back ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ SHOULDi-back ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ SHOULDi-back ---
[INFO] Packaging webapp
[INFO] Assembling webapp [SHOULDi-back] in [/home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target/SHOULDi-back]
[INFO] Processing war project
[INFO] Copying webapp resources [/home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/src/main/webapp]
[INFO] Webapp assembled in [293 msecs]
[INFO] Building war: /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target/SHOULDi-back.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ SHOULDi-back ---
[INFO] Installing /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target/SHOULDi-back.war to /home/ec2-user/.m2/repository/com/zenith/SHOULDi-back/1.0-SNAPSHOT/SHOULDi-back-1.0-SNAPSHOT.war
[INFO] Installing /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/pom.xml to /home/ec2-user/.m2/repository/com/zenith/SHOULDi-back/1.0-SNAPSHOT/SHOULDi-back-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.207 s
[INFO] Finished at: 2017-12-31T00:24:46+00:00
[INFO] Final Memory: 19M/48M
[INFO] ------------------------------------------------------------------------
Archiving artifacts
Deploying /home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target/SHOULDi-back.war to container Tomcat 7.x Remote with context Project2
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/home/ec2-user/.jenkins/workspace/Project2/SHOULDi-back/target/SHOULDi-back.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:192)
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:997)
at hudson.FilePath.act(FilePath.java:975)
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:1749)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:421)
Caused by: java.net.ConnectException: Connection timed out (Connection timed out)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:357)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:561)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:876)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:889)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:173)
... 17 more
java.net.ConnectException: Connection timed out (Connection timed out)

我该如何解决这个问题?

我的 tomcat 凭据位于[tomcat 目录]/conf/tomcat-users.xml 中,如下所示:

<tomcat-users>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcatgui" password="password" roles="manager-gui" />
<user username="project2" password="Z3n1th0x47726f7570" roles="manager-script" />
</tomcat-users>

最佳答案

由于这是连接超时,

  1. 检查编辑 tomcat-users.xml 后是否重新启动 tomcat 实例
  2. 检查jenkins是否有权访问tomcat实例。
  3. 用户凭据是否正确

关于java - 错误: Build step failed with exception org. codehaus.cargo.container.ContainerException:无法重新部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48040265/

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