【发布时间】:2017-05-24 07:52:50
【问题描述】:
我只是试图运行示例代码(通过 STS IDE 作为 Spring Boot 应用程序),但它只是终止(并且没有发生错误)。从git下载的,没有修改。
构建 RESTful Web 服务 示例代码:https://spring.io/guides/gs/rest-service/ Git 仓库:git clone https://github.com/spring-guides/gs-rest-service.git
**注意:我尝试的一件事,将 [spring-boot-starter-tomcat] 放入我的 maven 依赖项并下载,但无济于事。
:: Spring Boot :: (v1.4.3.RELEASE)
2017-01-09 17:33:14.942 信息 5548 --- [主要] hello.Application : 启动应用程序 TDL05100504 与 PID 5548 (C:\wm_dev\gs-rest-service\complete\target\classes 由 marshw2 启动 在 C:\wm_dev\gs-rest-service\complete) 2017-01-09 17:33:14.946 信息 5548 --- [主]你好。应用程序: 没有活动配置文件集,回退到默认配置文件:默认 2017-01-09 17:33:15.043 信息 5548 --- [主要] s.c.a.AnnotationConfigApplicationContext : 刷新 org.springframework.context.annotation.AnnotationConfigApplicationContext@6dc17b83: 启动日期 [Mon Jan 09 17:33:15 EST 2017];上下文层次的根 2017-01-09 17:33:17.526 信息 5548 --- [主要] o.s.j.e.a.AnnotationMBeanExporter :为 JMX 注册 bean 启动时曝光 2017-01-09 17:33:17.553 INFO 5548 --- [
main] hello.Application : 启动的应用程序 在 3.224 秒内(JVM 运行 4.192) 2017-01-09 17:33:17.555 信息 5548 --- [线程 1] s.c.a.AnnotationConfigApplicationContext : 结束 org.springframework.context.annotation.AnnotationConfigApplicationContext@6dc17b83: 启动日期 [Mon Jan 09 17:33:15 EST 2017];上下文层次的根 2017-01-09 17:33:17.559 信息 5548 --- [线程 1] o.s.j.e.a.AnnotationMBeanExporter :取消注册 JMX 公开 关闭时的 bean
【问题讨论】:
-
尝试从 start.spring.io 下载一个 Spring Boot 示例并将您的代码添加到其中。
-
哪个示例代码?这里的问题应该是自包含的。发布链接是不够的,但您甚至没有这样做。
-
代码是否启动任何 WebServer 或其他具有保持进程运行的非守护线程的东西。发布你的主要方法。
-
我很抱歉。它是构建 RESTful Web 服务的主要示例。 spring.io/guides/gs/rest-service git clone github.com/spring-guides/gs-rest-service.git
-
@KlausGroenbaek - 不,它只是试图公开一个端点,然后打印“Hello World”。我现在有问题中代码的链接。
标签: java spring spring-boot spring-rest