Выйти немедленно при использовании Spring-Boot-Starter-Jetty - PullRequest
0 голосов
/ 15 апреля 2019

Я использую spring-boot-starter-jetty для замены spring-boot-starter-tomcat. Pom.xml так:

<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-jetty</artifactId>
</dependency>

Но когда я бегу с mvn spring-boot:run, я получаю:

2019-04-15 11:39:54,583 INFO (MBeanExporter.java:433)- Registering beans for JMX exposure on startup
2019-04-15 11:39:54,585 INFO (MBeanExporter.java:895)- Bean with name 'dataSource' has been autodetected for JMX exposure
2019-04-15 11:39:54,592 INFO (MBeanExporter.java:668)- Located MBean 'dataSource': registering with JMX server as MBean [com.alibaba.druid.spring.boot.autoconfigure:name=dataSource,type=DruidDataSourceWrapper]
2019-04-15 11:39:54,601 INFO (DefaultLifecycleProcessor.java:351)- Starting beans in phase 2147483647
2019-04-15 11:39:54,615 INFO (StartupInfoLogger.java:59)- Started Application in 10.888 seconds (JVM running for 16.338)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.971 s
[INFO] Finished at: 2019-04-15T11:39:54+08:00
[INFO] Final Memory: 72M/383M
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "offical" could not be activated because it does not exist.
2019-04-15 11:39:55,073 INFO (AbstractApplicationContext.java:993)- Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@16af2879: startup date [Mon Apr 15 11:39:44 CST 2019]; root of context hierarchy
2019-04-15 11:39:55,073 INFO (DefaultLifecycleProcessor.java:366)- Stopping beans in phase 2147483647
2019-04-15 11:39:55,073 INFO (MBeanExporter.java:451)- Unregistering JMX-exposed beans on shutdown
2019-04-15 11:39:55,081 INFO (MBeanRegistrationSupport.java:183)- Unregistering JMX-exposed beans
2019-04-15 11:39:55,086 INFO (DruidDataSource.java:1885)- {dataSource-1} closing ...
2019-04-15 11:39:55,095 INFO (DruidDataSource.java:1955)- {dataSource-1} closed

Какова возможная причина?

1 Ответ

0 голосов
/ 15 апреля 2019

Я решил это путем удаления spring.main.web-application-type в application.yml:

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...