Привет, у меня есть это сообщение при запуске загрузочного приложения Spring. Мой основной класс имеет @SpringBootApplication и выглядит так:
@SpringBootApplication
public class SouscriptionServiceOptionnelApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return configureApplication(builder);
}
public static void main(String[] args) {
configureApplication(new SpringApplicationBuilder()).run(args);
}
private static SpringApplicationBuilder configureApplication(SpringApplicationBuilder builder) {
return builder.sources(SouscriptionServiceOptionnelApplication.class);
}
POM. XML выглядит так:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!---->
<groupId>fr.toto</groupId>
<artifactId>toto</artifactId>
<version>1.1.0</version>
<!---->
<packaging>war</packaging>
<name>souscription-service-optionnel</name>
<description>Souscription aux services optionnels</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<java.version>1.7</java.version>
</properties>
<dependencies>
<!-- ISIIs commons -->
<dependency>
<groupId>fr.toto.isiis</groupId>
<artifactId>toto-commons</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Apache commons text -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.1</version>
</dependency>
<!-- Apache httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Servlet 2.5 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-legacy</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
<!-- Spring Boot starters -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
2020-01-31 14: 51: 59.785 ОШИБКА 358776 - - [main] osboot.SpringApplication: сбой запуска приложения
org.springframework.context.ApplicationContextException: невозможно запустить встроенный контейнер; вложенным исключением является org.springframework.context.ApplicationContextException: невозможно запустить EmbeddedWebApplicationContext из-за отсутствия компонента EmbeddedServletContainerFactory. в org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefre sh (EmbeddedWebApplicationContext. java: 137) ~ [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] в org.springframework .context.support.AbstractApplicationContext.refre sh (AbstractApplicationContext. java: 537) ~ [spring-context-4.3.9.RELEASE.jar: 4.3.9.RELEASE] в org.springframework.boot.context.embedded .EmbeddedWebApplicationContext.refre sh (EmbeddedWebApplicationContext. java: 122) ~ [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] в org.springframework.boot.SpringApplication.refre sh ( SpringApplication. java: 693) ~ [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] в org.springframework.boot.SpringApplication.refreshContext (SpringApplication. java: 360) ~ [spring -boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] в org.springframework.boot.SpringApplication.run (SpringApplication. java: 303) ~ [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] at org.springframework.boot.builder.SpringApplicationBuilder.run (SpringApplicat ionBuilder. java: 134) [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] по адресу fr.edf.souscriptionserviceoptionnel.SouscriptionServiceOptionnelApplication.main (SouscriptionServiceOptionnelApplication. java: 27) [классы /: na] Причина: org.springframework.context.ApplicationContextException: невозможно запустить EmbeddedWebApplicationContext из-за отсутствия компонента EmbeddedServletContainerFactory. в org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory (EmbeddedWebApplicationContext. java: 189) ~ [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] в org.spr context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer (EmbeddedWebApplicationContext. java: 162) ~ [spring-boot-1.5.4.RELEASE.j``ar: 1.5.4.RELEASE] в org.springframework.boot.context.edded. EmbeddedWebApplicationContext.onRefre sh (EmbeddedWebApplicationContext. java: 134) ~ [spring-boot-1.5.4.RELEASE.jar: 1.5.4.RELEASE] ... 7 общих кадров пропущено