[spring-boot]sonar这坑货……

来源:互联网 发布:unity3d 5.3.4f1 下载 编辑:程序博客网 时间:2024/05/18 01:31

Q:spring boot启动后自动关闭,what fuck

spring boot启动日志:

D:\project\spring-boot-guide>mvn spring-boot:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building spring-boot Maven Webapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.4.RELEASE:run (default-cli) > test-compile @ spring-boot >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spring-boot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ spring-boot ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ spring-boot ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\project\spring-boot-guide\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ spring-boot ---
[INFO] No sources to compile
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.4.RELEASE:run (default-cli) < test-compile @ spring-boot <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.4.RELEASE:run (default-cli) @ spring-boot ---


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.5.4.RELEASE)


2017-06-09 15:07:29.320  INFO 2076 --- [           main] c.m.s.guide.controller.GuideController   : Starting GuideController on PC-JIAYI with PID 2076 (D:\project\spring-boot-guide\target\classes started by jiayi in D:\project\spring-boot-guide)
2017-06-09 15:07:29.336  INFO 2076 --- [           main] c.m.s.guide.controller.GuideController   : No active profile set, falling back to default profiles: default
2017-06-09 15:07:29.375  INFO 2076 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6fc0559b: startup date [Fri Jun 09 15:07:29 CST 2017]; root of context hierarchy
2017-06-09 15:07:30.474  INFO 2076 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-06-09 15:07:30.484  INFO 2076 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2017-06-09 15:07:30.486  INFO 2076 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.15
2017-06-09 15:07:30.568  INFO 2076 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-06-09 15:07:30.568  INFO 2076 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1196 ms
2017-06-09 15:07:30.682  INFO 2076 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-06-09 15:07:30.686  INFO 2076 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-06-09 15:07:30.687  INFO 2076 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-06-09 15:07:30.687  INFO 2076 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-06-09 15:07:30.687  INFO 2076 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-06-09 15:07:30.952  INFO 2076 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6fc0559b: startup date [Fri Jun 09 15:07:29 CST 2017]; root of context hierarchy
2017-06-09 15:07:31.011  INFO 2076 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/],methods=[GET]}" onto public java.lang.String club.michaeljy.springboot.guide.controller.GuideController.home()
2017-06-09 15:07:31.015  INFO 2076 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servle
t.http.HttpServletRequest)
2017-06-09 15:07:31.016  INFO 2076 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletReq
uest,javax.servlet.http.HttpServletResponse)
2017-06-09 15:07:31.047  INFO 2076 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-06-09 15:07:31.048  INFO 2076 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-06-09 15:07:31.085  INFO 2076 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-06-09 15:07:31.189  INFO 2076 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2017-06-09 15:07:31.244  INFO 2076 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-06-09 15:07:31.249  INFO 2076 --- [           main] c.m.s.guide.controller.GuideController   : Started GuideController in 2.294 seconds (JVM running for 4.799)
2017-06-09 15:07:31.250  INFO 2076 --- [           main] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6fc0559b: startup date [Fri Jun 09 15:07:29 CST 2017]; root of context hierarchy
2017-06-09 15:07:31.251  INFO 2076 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown


A:一个很简单的问题,搞得自己很惆怅啊!后来发现是sonar指引我犯错的!


如上所示,因为idea集成sonarLint的原因,SpringApplication.run这一行代码给我报红了,因为没有关闭流,我习惯性地安照sonar指引把流关了。然后启动项目,发现始终访问不到端口号,后来发现是sonar坑了我,自己把流关了还想访问tomcat?……

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 如果一年的公休日耍不完怎么办 我一个月要歇三天班怎么办 学校没给报到证怎么办 员工休息一天老板拉着脸怎么办 换工作了报到证怎么办 幼儿园的孩子不写作业怎么办 幼儿园宝宝不写作业怎么办 幼儿园孩子不写作业怎么办 光盘数据面写字了怎么办 娃娃的手断了怎么办 联币金融跑路了怎么办 胃消化不了想吐怎么办 吃撑了恶心想吐怎么办 mac口红膏体晃动怎么办 excl图标和以前不一样了怎么办 冰箱显示板坏了怎么办 冰箱电脑显示屏坏了怎么办 冰箱的电子显示屏坏了怎么办 指导别人炒股亏损了怎么办 没有协议委托别人炒股亏损怎么办 炒股亏了很多钱崩溃了怎么办 帮人炒股亏了很多钱怎么办 破净买入继续跌怎么办 国画颜色上错了怎么办 宝宝5个月脸一直开裂怎么办 宝宝冻脸怎么办小妙招 3岁小儿长期便秘怎么办 脚裂了怎么办小妙招 宝宝脸风吹裂了怎么办 宝宝脸被风吹裂了怎么办 小宝贝的手有时候抖怎么办 打球把手戳肿了怎么办 阴茎上皮肤皴了怎么办 手皮肤干燥起皮怎么办 一到冬天手脚冰凉怎么办 脸上的皮肤被搓掉了怎么办 皮肤的表皮搓掉了怎么办 固体水彩经常掉出来怎么办 画水彩纸皱了怎么办 画完水彩纸皱了怎么办 旗袍后面隐形拉链气包怎么办