使用Spring boot 嵌入的tomcat不能启动: Unregistering JMX-exposed beans on shutdown

新建一个spring boot的web项目,运行之后控制台输出“Unregistering JMX-exposed beans on shutdown”,tomcat也没有运行。寻找原因,看了下pom.xml文件中tomcat依赖关系如下:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

将<scope>provided</scope>注释掉,重新运行项目便可启动嵌入的tomcat服务器:Tomcat started on port(s): 8080 (http)

猜你喜欢

转载自www.cnblogs.com/cailijuan/p/8981009.html