就写了个入门测试程序 结果启动了就自动关闭 求各路大神指点

珍惜每一个遇见 2017-09-19 05:00:29
就写了个入门测试程序 结果启动了就自动关闭 求各路大神指点
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>cm.wesure</groupId>
<artifactId>TestBoot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>


package cm.wesure.TestBoot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class Application {

@RequestMapping("/")
public String greeting() {
return "Hello World!";
}

public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}


2017-09-19 16:55:37.919  INFO 1920 --- [           main] cm.wesure.TestBoot.Application           : Starting Application on v_qmliao-pc0 with PID 1920 (F:\workspace\TestBoot\target\classes started by v_qmliao in F:\workspace\TestBoot)
2017-09-19 16:55:37.945 INFO 1920 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2c039ac6: startup date [Tue Sep 19 16:55:37 CST 2017]; root of context hierarchy
2017-09-19 16:55:38.506 INFO 1920 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2017-09-19 16:55:38.510 INFO 1920 --- [ main] cm.wesure.TestBoot.Application : Started Application in 0.713 seconds (JVM running for 0.939)
2017-09-19 16:55:38.511 INFO 1920 --- [ Thread-1] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2c039ac6: startup date [Tue Sep 19 16:55:37 CST 2017]; root of context hierarchy
2017-09-19 16:55:38.511 INFO 1920 --- [ Thread-1] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
...全文
191 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧