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服务器时间同步
    07_DICTIONARY_ACCESSIBILITY
    Oracle监听静态注册和动态注册
    Oracle安装基本步骤
    笔试面试(2)阿里巴巴2014秋季校园招聘-软件研发工程师笔试题详解
    Global and Local Coordinate Systems
    齐次坐标(Homogeneous Coordinates)
    朴素贝叶斯分类器的应用
    图像数据到网格数据-1——MarchingCubes算法
    PCL源码剖析之MarchingCubes算法
  • 原文地址:https://www.cnblogs.com/rain64531264/p/8120602.html
Copyright © 2011-2022 走看看