인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

인프런 커뮤니티 질문&답변

작성자 없음

작성자 정보가 삭제된 글입니다.

Jenkins를 이용한 CI/CD Pipeline 구축

실습24) Jenkins를 이용하여 Tomcat 서버에 배포하기

AWS Jenkins + Tomcat 연동 문제

작성

·

1.1K

0

안녕하세요? 강의대로 모두 따라했는데, Build할 때 아래와 같이 문제가 발생합니다 ㅠ


[DeployPublisher][INFO] Deploying /var/lib/jenkins/workspace/JunyHarang-Tomcat-Project/target/hello-world.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/JunyHarang-Tomcat-Project/target/hello-world.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:1192) at hudson.FilePath.act(FilePath.java:1175) 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:47) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:765) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:709) at hudson.model.Run.execute(Run.java:1924) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:107) at hudson.model.Executor.run(Executor.java:449) Caused by: java.net.ConnectException: Connection timed out (Connection timed out) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) at java.base/java.net.Socket.connect(Socket.java:609) at java.base/java.net.Socket.connect(Socket.java:558) at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:508) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603) at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:276) at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:375) at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:396) at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1253) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081) at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:567) 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.net.ConnectException: Connection timed out (Connection timed out) at java.base/java.net.PlainSocketImpl.socketConnect(Native Method) at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412) at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255) at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237) at java.base/java.net.Socket.connect(Socket.java:609) at java.base/java.net.Socket.connect(Socket.java:558) at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:508) at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:603) at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:276) at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:375) at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:396) at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1253) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1187) at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1081) at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1015) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:567) 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:1192) at hudson.FilePath.act(FilePath.java:1175) 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:47) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:816) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:765) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:709) at hudson.model.Run.execute(Run.java:1924) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:107) at hudson.model.Executor.run(Executor.java:449) Build step 'Deploy war/ear to a container' marked build as failure Finished: FAILURE

답변 1

0

Dowon Lee님의 프로필 이미지
Dowon Lee
지식공유자

안녕하세요, 이도원입니다.

올려주신 에러 메시지를 확인해 보면, Tomcat 서버에 접속이 되지 않는 것 같습니다. Jenkins를 Docker로 기동하고 Tomcat서버를 Host PC(Windows 또는 MacOS)에서 기동하여 사용하는 경우에는 Jenkins 서버에서 Tomcat으로의 연결에 문제가 없어야 합니다. 해당 Tomcat의 정확한 IP address 및 PORT 번호를 확인해 보시기 바랍니다. 만약 Tomcat 서버를 Docker 컨테이너로 기동하여 사용하는 경우라면, IP Address에 172.x.x.x 로 시작하는 Tomcat container의 IP address를 사용하시면 됩니다. 끝으로, HOST PC에서 기동하시던, Docker 컨테이너로 기동하시던 Tomcat 서버의 manager 컨텍스트가 사용가능해야 하고 적절한 계정으로 접근이 되어야 합니다. 이 부분은 Section8에서 Tomcat 서버 설정을 참고하셔서 설정을 확인해 보시기 바랍니다.

감사합니다.

작성자 없음

작성자 정보가 삭제된 글입니다.

질문하기