- [SPRING] ApplicationContextException : ServletWebServerFactory 빈이 없어서 ServletWebServerApplicationContext를 시작할 수 없습니다. 목차
ApplicationContextException : ServletWebServerFactory 빈이 없어서 ServletWebServerApplicationContext를 시작할 수 없습니다.
스프링 부트를 사용하여 스프링 배치 애플리케이션을 작성했습니다. 로컬 시스템에서 명령 행과 클래스 경로를 사용하여 해당 애플리케이션을 실행하려고하면 정상적으로 실행됩니다. 그러나 리눅스 서버에서 실행하려고했을 때 예외적으로 다음과 같이 표시됩니다.
Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
해결법
1.application.properties에서 다음을 수행합니다.
application.properties에서 다음을 수행합니다.
spring.main.web-application-type=none
application.yml을 사용하는 경우 다음을 추가하십시오.
spring:
main:
web-application-type: none
@SpringBootApplication
public class YourAppliationName extends SpringBootServletInitializer{
public static void main(String[] args) {
SpringApplication.run(YourAppliationName.class, args);
}
}
YourApplicationName을 꼭 자신의 애플리케이션 네임으로 적어주어야 합니다 ~!
'Spring > Spring 오류' 카테고리의 다른 글
.gitignore가 작동하지 않을때 대처법 (0) | 2020.02.11 |
---|---|
[docker]com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure 오류 (0) | 2020.01.30 |
[docker]window 10 도커(docker)설치하기 (0) | 2020.01.28 |
[Spring-boot] Tomcat오류 org.apache.catalina.LifecycleException (0) | 2020.01.20 |
SpringBoot -'url'오류 잡기 (0) | 2020.01.19 |