Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.

错误详细信息:

1
2
3
4
5
6
7
8
9
10
11
12
***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 1 of constructor in com.alibaba.cloud.sentinel.gateway.scg.SentinelSCGAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.

为什么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.