[Java][Spring Boot] Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean 에러
Spring Boot Version: 1.3.0.RELEASE
증상
개발한 프로그램을 IntelliJ 에서 구동 시 문제없이 구동이 되나 실행가능한 jar 파일로 만든 후 구동 시 아래와 같은 로그가 발생하며 프로그램이 종료된다.
'
00:43:53.016 [main] WARN o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
00:43:53.027 [main] ERROR o.s.boot.SpringApplication - Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133) ~[testApp.jar:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[testApp.jar:na]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[testApp.jar:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [testApp.jar:na]
at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347) [testApp.jar:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) [testApp.jar:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112) [testApp.jar:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101) [testApp.jar:na]
at {PackageName}.{ClassName}.main(MsPushSchApplication.java:14) [testApp.jar:na]
Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:183) ~[testApp.jar:na]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:156) ~[testApp.jar:na]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130) ~[testApp.jar:na]
... 8 common frames omitted
원인
=================================
2016.02.02 업데이트
1004lucifer
Maven 을 사용하지 않고 IDE(Eclipse, IntelliJ) 툴에서 바로 Export 받았기 때문에 문제가 된 것이며 Maven 을 통해 빌드하여 jar 파일 생성 시 정상적으로 되는것을 확인했다.
=================================
해결방법
* 나와 동일한 증상을 가지고 있는 사람이 있었다.
http://stackoverflow.com/questions/35078117/error-unable-to-start-embeddedwebapplicationcontext-due-to-missing-embeddedser
=================================
2016.02.02 업데이트
Maven 을 사용해서 빌드하여 jar 파일 생성 시 정상적으로 구동 되는것을 확인했다.
IntelliJ 에서 아래와 같이 빌드를 했다.
=================================
댓글
댓글 쓰기