zoukankan      html  css  js  c++  java
  • spring boot starter工程启动就关闭的问题

    配置了maven中的mirror后,maven用起来就像是飞一般的感觉。

    <mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>

    近期在入手Spring框架,经过十几年沉淀的东西,确实博大精深。

    作为Starter(老菜鸟)翻了几本过时的pdf后,终于痛下决心从http://spring.io/guides开始一点一点的啃。

    第一个hello world webserivce工程,就遇到了一个神奇的问题

    Spring shutdown on start up!!!具体的错误,居然不是用ERROR标识,而是用info

    INFO 4068 --- [lication Thread] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext

    INFO 4068 --- [lication Thread] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown

    这坑爹的货。但是按着教程操作的东西都会出错。。W.H.Y?

    原来使用Spring Tool Suite(STS)向导(Import Spring Getting Started Content)新建的Rest 工程中自带的pom.xml文件内容与http://spring.io/guides中的内容不符。

    重点是少了如下依赖:

    <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>

            <dependency>

                <groupId>com.jayway.jsonpath</groupId>

                <artifactId>json-path</artifactId>

                <scope>test</scope>

            </dependency>

    补上,就不会一启动就自动关闭Spring了。

    -----------------------------------------------------------------------------------

    就跟小时候做语文课后习题一样——答案就在文章中。

    BTW,今天看的是

    Building a RESTful Web Service

    holy血,一把年纪了还在hello world,8特,I DO LIKE IT.

    Spring shutdown on start up

  • 相关阅读:
    linux eclipse cdt make error 127
    centos 安装网络错误
    c++ string 结束符‘00’
    北京市工资交税情况
    gprof参数说明及常见错误
    【转】Eclipse Plugin 在 Console上打印出message
    C++做client Java做客户端传送数据
    word统计章节字数
    【转】Profiling application LLC cache misses under Linux using Perf Events
    【转】eclipse插件开发,调试运行,导出与安装
  • 原文地址:https://www.cnblogs.com/rain64531264/p/8120602.html
Copyright © 2011-2022 走看看