• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

Tomcat manager 로그인 문제

23.07.29 18:18 작성 23.07.29 21:26 수정 조회수 543

0

1번 질문

 

Started by user Administrator
Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/Third
The recommended git tool is: NONE
No credentials specified
 > git rev-parse --resolve-git-dir /var/jenkins_home/workspace/Third/.git # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/joneconsulting/cicd-web-project # timeout=10
Fetching upstream changes from https://github.com/joneconsulting/cicd-web-project
 > git --version # timeout=10
 > git --version # 'git version 2.30.2'
 > git fetch --tags --force --progress -- https://github.com/joneconsulting/cicd-web-project +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision f9b8f5340aeeba8d86db9eabc33d1ef2f892de4b (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f f9b8f5340aeeba8d86db9eabc33d1ef2f892de4b # timeout=10
Commit message: "added the master branch"
 > git rev-list --no-walk f9b8f5340aeeba8d86db9eabc33d1ef2f892de4b # timeout=10
Parsing POMs
Established TCP socket on 37583
[Third] $ java -cp /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.14.jar:/var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3.9.3/boot/plexus-classworlds-2.7.0.jar:/var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3.9.3/conf/logging jenkins.maven3.agent.Maven35Main /var/jenkins_home/tools/hudson.tasks.Maven_MavenInstallation/Maven3.9.3 /var/jenkins_home/war/WEB-INF/lib/remoting-3107.v665000b_51092.jar /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.14.jar /var/jenkins_home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.14.jar 37583
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven:  -B -f /var/jenkins_home/workspace/Third/pom.xml clean compile package
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< com.njonecompany.web:web >----------------------
[INFO] Building cicd-web-project maven webapp 1.0
[INFO]   from pom.xml
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ web ---
[INFO] Deleting /var/jenkins_home/workspace/Third/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ web ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ web ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 3 source files with javac [debug target 1.8] to target/classes
[WARNING] bootstrap class path not set in conjunction with -source 8
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ web ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ web ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ web ---
[INFO] skip non existing resourceDirectory /var/jenkins_home/workspace/Third/src/test/resources
[INFO] 
[INFO] --- compiler:3.11.0:testCompile (default-testCompile) @ web ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 1 source file with javac [debug target 1.8] to target/test-classes
[WARNING] bootstrap class path not set in conjunction with -source 8
[INFO] 
[INFO] --- surefire:2.22.0:test (default-test) @ web ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.njonecompany.web.TestWelcome
10:40:32,162 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:40:32,162 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
10:40:32,162 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/var/jenkins_home/workspace/Third/target/classes/logback.xml]
10:40:32,209 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
10:40:32,209 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
10:40:32,212 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
10:40:32,242 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - This appender no longer admits a layout as a sub-component, set an encoder instead.
10:40:32,242 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - To ensure compatibility, wrapping your layout in LayoutWrappingEncoder.
10:40:32,242 |-WARN in ch.qos.logback.core.ConsoleAppender[STDOUT] - See also http://logback.qos.ch/codes.html#layoutInsteadOfEncoder for details
10:40:32,242 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [com.njonecompany.web] to DEBUG
10:40:32,242 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity of logger [com.njonecompany.web] to false
10:40:32,242 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[com.njonecompany.web]
10:40:32,242 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
10:40:32,242 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
10:40:32,242 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
10:40:32,243 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5fb759d6 - Registering current configuration as safe fallback point

2023-07-29 10:40:32 [main] DEBUG c.n.web.controller.WelcomeController - Welcome to njonecompany.com...
Sat Jul 29 10:40:32 UTC 2023

MockHttpServletRequest:
      HTTP Method = GET
      Request URI = /
       Parameters = {}
          Headers = []
             Body = <no character encoding set>
    Session Attrs = {}

Handler:
             Type = com.njonecompany.web.controller.WelcomeController
           Method = com.njonecompany.web.controller.WelcomeController#index(Model)

Async:
    Async started = false
     Async result = null

Resolved Exception:
             Type = null

ModelAndView:
        View name = index
             View = null
        Attribute = msg
            value = Hi, there
        Attribute = today
            value = Sat Jul 29 10:40:32 UTC 2023

FlashMap:
       Attributes = null

MockHttpServletResponse:
           Status = 200
    Error message = null
          Headers = [Content-Language:"en"]
     Content type = null
             Body = 
    Forwarded URL = /WEB-INF/views/index.jsp
   Redirected URL = null
          Cookies = []
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.592 s - in com.njonecompany.web.TestWelcome
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[JENKINS] Recording test results
[INFO] 
[INFO] --- war:3.2.2:war (default-war) @ web ---
[INFO] Packaging webapp
[INFO] Assembling webapp [web] in [/var/jenkins_home/workspace/Third/target/hello-world]
[INFO] Processing war project
[INFO] Copying webapp resources [/var/jenkins_home/workspace/Third/src/main/webapp]
[INFO] Webapp assembled in [27 msecs]
[INFO] Building war: /var/jenkins_home/workspace/Third/target/hello-world.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.349 s
[INFO] Finished at: 2023-07-29T10:40:34Z
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /var/jenkins_home/workspace/Third/pom.xml to com.njonecompany.web/web/1.0/web-1.0.pom
[JENKINS] Archiving /var/jenkins_home/workspace/Third/target/hello-world.war to com.njonecompany.web/web/1.0/web-1.0.war
[DeployPublisher][INFO] Attempting to deploy 1 war file(s)
[DeployPublisher][INFO] Deploying /var/jenkins_home/workspace/Third/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/jenkins_home/workspace/Third/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:1198)
	at hudson.FilePath.act(FilePath.java:1181)
	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:818)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
	at hudson.model.Run.execute(Run.java:1925)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username and password you provided are not correct (error 401)
	at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:704)
	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
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://192.168.0.14:8088/manager/text/list
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:577)
	... 22 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username and password you provided are not correct (error 401)
	at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:704)
	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:1198)
	at hudson.FilePath.act(FilePath.java:1181)
	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:818)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
	at hudson.model.Run.execute(Run.java:1925)
	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://192.168.0.14:8088/manager/text/list
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
	at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:577)
	... 22 more
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

2번 질문

 

 

  1. Tomcat > Manager App 로그인이 안 됩니다,,

설정하신대로 따라 해서 8088 서버는 접속이 되나, Manager App 아이디 비번이 계속 오류가 있는 것으로 보아 어딘가에서 문제가 있는 것 같습니다.

  1. 그래서 jenkins에서 Third project build 진행할 때도 역시 오류가 뜨는 것 같습니다.

 

m1 pro 사용중입니다.

답변 1

답변을 작성해보세요.

0

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

말씀하신 것처럼 Tomcat Manager에 접속이 안되신다면, Jenkins에서 액세스하는 데에도 문제가 있을 것 같습니다. 실제로 에러 메시지에서도 username/password가 정확하지 않다고 표시되고 있는 것으로 봐서는, 설정이 잘못 된게 맞는 것 같습니다. 아래 내용을 확인해 보시기 바랍니다.

  1. Tomcat 서버를 기동하는 방식은? MacOS에서 직접 실행? Docker로 실행? 각 실행 방법에 따른 정확한 tomcat-users.xml 파일이 수정 되어 있는지 확인 필요

    1. 어떤 방법으로 실행하신 지 하고, 해당 명령어 전체를 공유 부탁드립니다.

    2. 수정하신 tomcat-users.xml 파일의 정확한 위치와 파일을 공유 부탁드립니다.

  2. 웹브라우저에서 http://localhost:8088/manager 로 접근 시, 설정하신 tomcat/tomcat 으로 접속이 가능한지 확인 필요

위 내용이 확인 된 다음에 Jenkins에서 배포를 하시는 게 필요 합니다.

확인해 보시고 추가 글 남겨주세요.

감사합니다.