如何解决SprintBoot启动卡在Started XXXXXXXX in 7.47 seconds?

今天从 http://start.spring.io/ 上下载了 springboot 的demo 并在本机用 gradle 打开。

原始版本没有添加web的依赖,我自己加上了

implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

这个是它自动生成的类,我加了两句,影响不大

package com.example.demoGradle;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;

@SpringBootApplication
public class DemoGradleApplication {
    @RequestMapping("/")
    public String hello() {
        return "Hello World";
    }
        public static void main(String[] args) {
        SpringApplication.run(DemoGradleApplication.class, args);
    }
}

运行之后
图片描述

如图片所示,卡在这个地方

2019-04-24 18:09:50.780  INFO 8452 --- [           main] c.e.demoGradle.DemoGradleApplication     : Started DemoGradleApplication in 6.326 seconds (JVM running for 7.58)

然后就不在进行下去了
问题是在我添加了web的依赖之后出现的
各处搜索之后无果,特来请教,还望得到解答,谢谢

阅读 18.9k
4 个回答

这表示启动完成了,端口是 8082

说明已经启动完成了呀;端口8082;这个时候访问 http://localhost:8082/${path}就可以了

这就是启动成功了,started 是过去式。

好的好的,谢谢大家

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