spring boot v1.5.8.RELEASE 启动失败

spring boot v1.5.8.RELEASE 启动失败

<?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>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.8.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </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>

. _
/\ / ' _(_) _ \
( ( )__ | ' | '_| | '_ / _` | \
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.8.RELEASE)

2017-10-23 17:14:08.638 INFO 6708 --- [ main] com.example.demo.DemoApplication : Starting DemoApplication on Youme-T450s with PID 6708 (D:EclipseProjectsdemotargetclasses started by Youme in D:EclipseProjectsdemo)
2017-10-23 17:14:08.654 INFO 6708 --- [ main] com.example.demo.DemoApplication : No active profile set, falling back to default profiles: default
2017-10-23 17:14:08.701 INFO 6708 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@17baae6e: startup date [Mon Oct 23 17:14:08 CST 2017]; root of context hierarchy
2017-10-23 17:14:09.647 INFO 6708 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2017-10-23 17:14:09.662 INFO 6708 --- [ main] com.example.demo.DemoApplication : Started DemoApplication in 1.305 seconds (JVM running for 1.643)
2017-10-23 17:14:09.662 INFO 6708 --- [ Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@17baae6e: startup date [Mon Oct 23 17:14:08 CST 2017]; root of context hierarchy
2017-10-23 17:14:09.662 INFO 6708 --- [ Thread-2] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
但是换成v1.5.7.RELEASE就好了,很郁闷,Maven清理好多遍没有用。。

阅读 7.4k
6 个回答
新手上路,请多包涵

楼主有找到原因吗?我也遇到这个问题,其他版本是好的

添加以下依赖:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
新手上路,请多包涵

配置文件路径不对,看一下你的idea

新手上路,请多包涵

应该是少了依赖吧,试试添加下面的第一个依赖
<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>
新手上路,请多包涵

我刚接触spring boot没多久,也是在几天前使用1.5.8版本的时候遇到相同的问题,我是使用STS创建的工程,都是通过工具自动生成的maven依赖并在线更新,后来换到1.4.7就没有问题。我现在写这个的时候spring boot刚升级到1.5.9版本,我也试了试,没有出现这个问题,可以正常启动内置tomcat,但是我添加spring cloud相关依赖后,控制台又报错(应该是版本兼容有问题)导致不能启动。但是我百度的时候也有人基于1.5.8版本写了些文章,所以就不知道这个到底是什么情况。。。个人感觉1.5.x版本稳定性有待商榷。感觉spring官方似乎把精力都投入到2.x版本上了。所有我建议暂时还是使用1.4.7版本

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题