为什么bootstrap.yml比application.yml优先级高

最近遇到好几个与此有关的问题。

其中一个典型的问题是,明明bootstrap.yml指定了端口,但还是显示为默认的8080端口。最后我用了一个常规的死办法将bootstrap.yml改为application.yml就好了。

于是我不得不思考,为什么会出现这样的问题。通过搜索我了解到了以下几点。

springboot整合CXF时,启动报错

错误信息:

1
2
3
4
5
6
7
8
9
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 1 of constructor in org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration required a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'dispatcherServletRegistration' in 'DispatcherServletAutoConfiguration.DispatcherServletRegistrationConfiguration' not loaded because DispatcherServlet Registration found non dispatcher servlet dispatcherServlet
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' in your configuration.

我对测试的思考

说起来人生第一家互联网公司,教会了我蛮多的东西,虽然比较杂。如运维、测试、实施、开发等。基本上那个时候,哪里有需要,哪里就有我。

之前曾写过这么一篇文章论单元测试之重要性
这篇文章的背景是我处于创业公司的时期,那个时候做的比较杂,由于前后端一起做,功能越来越多,bug也就越来越多。最后发现因为赶着发布周期,不得不快,快的我们连单元测试以及自测都懒得弄。最后发布前,经理测试了一下,发现了一堆bug。于是我们周末加班改bug。

SpringBoot整合Apache-CXF实践

一、Apache CXF是什么?

Apache CXF 是一个开源的 Services 框架,CXF 帮助您利用 Frontend 编程 API 来构建和开发 Services ,像 JAX-WS 。这些 Services 可以支持多种协议,比如:SOAP、XML/HTTP、RESTful HTTP 或者 CORBA ,并且可以在多种传输协议上运行,比如:HTTP、JMS 或者 JBI,CXF 大大简化了 Services 的创建,同时它继承了 XFire 传统,一样可以天然地和 Spring 进行无缝集成。