我的 Spring Boot Web 应用程序在启动时立即停止,没有任何错误消息:
:: Spring Boot :: (v2.0.1.RELEASE)
2018-04-19 17:15:34.009 INFO 5600 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-04-19 17:15:34.013 INFO 5600 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.29
2018-04-19 17:15:34.027 INFO 5600 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/whf/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2018-04-19 17:15:34.129 INFO 5600 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-04-19 17:15:34.514 INFO 5600 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
当我删除spring-boot-starter-test
依赖项时,问题就消失了。这是我的pom.xml
:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.1.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.hyperledger.fabric-sdk-java</groupId>
<artifactId>fabric-sdk-java</artifactId>
<version>1.1.0-alpha</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<!-- remove this dependency can fix this problem -->
<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>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
我不知道这里发生了什么......
- - -更新 - - -
更改 spring boot 版本以1.5.x
解决问题。它是spring boot 2.0.1的错误吗?
- - - - -更新 - - - -
似乎有些东西阻止了日志打印到控制台。