Open bawker opened 4 years ago
오류설명: application.properties 파일에서 spring.profiles.include=oauth 세팅 되어 있는데, ProfileControllerTest->profile은_인증없이_호출된다() 에서는 "default" 값으로 체크해서 일단 테스트에서 오류가 납니다.
-----> test 디렉토리에 있는 application.properties파일 spring.profiles.include 부분을 지워보세요
기존에 올라온 질문이 아닌지 먼저 검색해주세요!
가장 자주 나온 제보
어떤 오류인가요?
오류설명: application.properties 파일에서 spring.profiles.include=oauth 세팅 되어 있는데, ProfileControllerTest->profile은_인증없이_호출된다() 에서는 "default" 값으로 체크해서 일단 테스트에서 오류가 납니다.
ProfileControllerTest->profile은_인증없이_호출된다() 에서 String expected = "oauth";로 변경한 후 테스트 하면 당연히 테스트 성공 되지만 AWS서버로 배포후에는 500에러가 발생합니다.
추가로 /home/ec2-user/app2/step2/zip 에서 deploy.sh를 실행 시키면 접속이 가능하지만 깃으로 푸시 한다음에 빌드 될때 뭔가 오류가 나는것 같습니다. CURRENT_PID=$(pgrep -fl freelec-springboot2-webservice | grep jar | awk '{print $1}') 가 작동 하지 않는 것 같고, pgrep -fl freelec-springboot2-webservice | grep java | awk '{print $1}' 로 변경 해도 이상이 없을까요?
프로젝트 주소
Github에 오류가 난 프로젝트를 올려주세요.
Github 주소를 작성해주지 않으시면 답변해드릴수가 없어요!
오류 로그
2020-07-15 15:59:37.452 INFO 5470 --- [ main] com.bbaker.book.springboot.Application : The following profiles are active: oauth,real-db,real 2020-07-15 15:59:40.223 INFO 5470 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode. 2020-07-15 15:59:42.431 INFO 5470 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-07-15 15:59:42.737 INFO 5470 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-07-15 15:59:42.737 INFO 5470 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 5116 ms 2020-07-15 15:59:43.208 INFO 5470 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2020-07-15 15:59:43.346 INFO 5470 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2020-07-15 15:59:43.531 INFO 5470 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2020-07-15 15:59:43.707 INFO 5470 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.10.Final} 2020-07-15 15:59:43.709 INFO 5470 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2020-07-15 15:59:43.990 INFO 5470 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final} 2020-07-15 15:59:44.540 INFO 5470 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect 2020-07-15 15:59:46.157 INFO 5470 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2020-07-15 15:59:47.030 INFO 5470 --- [ main] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory 2020-07-15 15:59:48.757 INFO 5470 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-07-15 15:59:48.984 INFO 5470 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index 2020-07-15 15:59:49.564 INFO 5470 --- [ main] s.a.ScheduledAnnotationBeanPostProcessor : No TaskScheduler/ScheduledExecutorService bean found for scheduled processing 2020-07-15 15:59:49.604 ERROR 5470 --- [ main] org.apache.catalina.util.LifecycleBase : Failed to start component [Connector[HTTP/1.1-8080]]
org.apache.catalina.LifecycleException: Protocol handler start failed at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) ~[tomcat-embed-core-9.0.22.jar!/:9.0.22] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.22.jar!/:9.0.22] at org.apache.catalina.core.StandardService.addConnector(StandardService.java:227) [tomcat-embed-core-9.0.22.jar!/:9.0.22] at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:263) [spring-boot-2.1.7.RELEASE.jar!/:2.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) [spring-context-5.1.9.RELEASE.jar!/:5.1.9.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743) [spring-boot-2.1.7.RELEASE.jar!/:2.1.7.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390) [spring-boot-2.1.7.RELEASE.jar!/:2.1.7.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.7.RELEASE.jar!/:2.1.7.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214) [spring-boot-2.1.7.RELEASE.jar!/:2.1.7.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203) [spring-boot-2.1.7.RELEASE.jar!/:2.1.7.RELEASE] at com.bbaker.book.springboot.Application.main(Application.java:26) [classes!/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) [freelec-springboot2-webservice-1.0-SNAPSHOT.jar:na] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) [freelec-springboot2-webservice-1.0-SNAPSHOT.jar:na] Exception in thread "http-nio-8080-exec-4" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy at ch.qos.logback.classic.spi.LoggingEvent.(LoggingEvent.java:119)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.log(Logger.java:765)
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
at java.util.logging.Logger.log(Logger.java:738)
at java.util.logging.Logger.doLog(Logger.java:765)
at java.util.logging.Logger.logp(Logger.java:1042)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:175)
at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:141)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1604)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
Exception in thread "http-nio-8080-exec-6" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
at ch.qos.logback.classic.spi.LoggingEvent.(LoggingEvent.java:119)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.log(Logger.java:765)
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
at java.util.logging.Logger.log(Logger.java:738)
at java.util.logging.Logger.doLog(Logger.java:765)
at java.util.logging.Logger.logp(Logger.java:1042)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:175)
at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:141)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1604)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
Exception in thread "http-nio-8080-exec-8" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
at ch.qos.logback.classic.spi.LoggingEvent.(LoggingEvent.java:119)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.log(Logger.java:765)
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
at java.util.logging.Logger.log(Logger.java:738)
at java.lang.Thread.run(Thread.java:748)