음료요정
12
2021-07-22 11:41:23 작성 2021-07-22 11:44:43 수정됨
1
81

EC2환경 같은소스, 2개 인스턴스에서 다른 작동, 톰캣은 떴으나 서블릿실행이 안됩니다





인스턴스별 현상이 다른데 원인을 모르겠습니다 

A는 톰캣 실행 후 Initializing Servlet 'dispatcherServlet'이 실행되고 정상 작동하는데

B는 실행만되고 아무런동작을 하지않고 curl로 api 찔러보면 응답은 합니다 



인스턴스별 다른 증상이라 인스턴스 문제인가 싶어 담당자문의했지만 어플리케이션 원인인거같다요..

근데 같은 소스로 배포했습니다 

 

원인 아시는분계실까요? 

몇일째 이거때문에 고생중입니다.. 도와주세요!



A) 정상

▶ INFO  11:17:06.606 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 2613 ms
▶ INFO  11:17:09.331 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:17:09.331 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:17:10.643 [localhost] [localhost-startStop-1] com.home.www.wwwBoApplication - Started wwwBoApplication in 7.74 seconds (JVM running for 16.925)
▶ INFO  11:17:10.648 [localhost] [localhost-startStop-1] com.home.www.ServletInitializer - Root context already created (using as parent).

로고 출력

▶ INFO  11:17:10.689 [localhost] [localhost-startStop-1] com.home.www.ServletInitializer - The following profiles are active: dev
▶ INFO  11:17:11.325 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 628 ms
▶ INFO  11:17:11.325 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 628 ms
▶ INFO  11:17:12.024 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:17:12.024 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:17:12.386 [localhost] [localhost-startStop-1] com.home.www.ServletInitializer - Started ServletInitializer in 1.737 seconds (JVM running for 18.668)
22-Jul-2021 11:17:12.419 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/apache-tomcat-8.5.69/webapps/ROOT.war] has finished in [13,895] ms
22-Jul-2021 11:17:12.425 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
22-Jul-2021 11:17:12.445 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 14030 ms
▶ INFO  11:17:12.563 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
▶ INFO  11:17:12.563 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
▶ INFO  11:17:12.577 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Completed initialization in 13 ms
▶ INFO  11:17:12.577 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Completed initialization in 13 ms
▶ DEBUG 11:17:12.625 [localhost] [http-nio-8080-exec-2] c.w.www.web.HealthCheckController - ########## healthCheck ##############################
▶ DEBUG 11:17:12.626 [localhost] [http-nio-8080-exec-1] c.w.www.web.HealthCheckController - ######## healthCheck ###############################
▶ INFO  11:17:12.660 [localhost] [http-nio-8080-exec-2] c.wonders.wms.config.LogInterceptor - requestId b0308e9e-9413-4dca-9533-3654a5cc6d10, url :[GET]/healthcheck/health?&_psip=10.zz.11.x , request take time: 56ms, status : 200
▶ INFO  11:17:12.660 [localhost] [http-nio-8080-exec-1] c.wonders.wms.config.LogInterceptor - requestId 0987793f-a576-43b2-a0fe-4dcc7d2d0ff1, url :[GET]/healthcheck/health?&_psip=10.xx.12.x , request take time: 49ms, status : 200


B) 비정상

▶ INFO  11:15:23.767 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 2633 ms
▶ INFO  11:15:23.767 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 2633 ms
▶ INFO  11:15:26.718 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:15:26.718 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:15:27.963 [localhost] [localhost-startStop-1] com.home.www.wwwBoApplication - Started wwwBoApplication in 7.884 seconds (JVM running for 18.278)
▶ INFO  11:15:27.968 [localhost] [localhost-startStop-1] com.home.www.ServletInitializer - Root context already created (using as parent).

로고 출력

▶ INFO  11:15:27.995 [localhost] [localhost-startStop-1] com.home.www.ServletInitializer - The following profiles are active: dev
▶ INFO  11:15:28.525 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 526 ms
▶ INFO  11:15:28.525 [localhost] [localhost-startStop-1] o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 526 ms
▶ INFO  11:15:29.223 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:15:29.223 [localhost] [localhost-startStop-1] o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - Autowired annotation is not supported on static fields: private static int com.home.www.service.BasicService.loginLimitCnt
▶ INFO  11:15:29.517 [localhost] [localhost-startStop-1] com.home.www.ServletInitializer - Started ServletInitializer in 1.548 seconds (JVM running for 19.832)
22-Jul-2021 11:15:29.550 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/apache-tomcat-8.5.69/webapps/ROOT.war] has finished in [13,988] ms
22-Jul-2021 11:15:29.556 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
22-Jul-2021 11:15:29.568 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 14091 ms
▶ INFO  11:16:23.730 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
▶ INFO  11:16:23.730 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
▶ INFO  11:16:23.740 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Completed initialization in 10 ms
▶ INFO  11:16:23.740 [localhost] [http-nio-8080-exec-1] o.s.web.servlet.DispatcherServlet - Completed initialization in 10 ms



0
  • 답변 1

  • 음료요정
    12
    2021-07-22 15:41:09

    자문자답... 해결됐습니다 

    서버에는 문제가 없었고 인스턴스교체시 ELB target이 누락되어 생긴 문제였습니다 

  • 로그인을 하시면 답변을 등록할 수 있습니다.