使用netty反应服务器通过这些启动器依赖项构建针对spring-boot 2.0.0.M4的应用程序时:
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-webflux')
我尝试设置management.port=9000
并在启动时收到此消息:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 1 of constructor in org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration$DifferentManagementContextConfiguration required a bean of type 'org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory' that could not be found.
- Bean method 'reactiveWebChildContextFactory' not loaded because @ConditionalOnClass did not find required class 'javax.servlet.Servlet'
- Bean method 'servletWebChildContextFactory' not loaded because @ConditionalOnClass did not find required class 'javax.servlet.Servlet'
Action:
Consider revisiting the conditions above or defining a bean of type 'org.springframework.boot.actuate.autoconfigure.web.ManagementContextFactory' in your configuration.
当我在javax.servlet-api
上添加显式依赖时:
compile('javax.servlet:javax.servlet-api:3.1.0')
spring-boot应用程序出现没有问题,management.port
值得到尊重。
对于具有spring-boot的响应式Web应用程序的此预期行为或reactiveWebChildContextFactory
的依赖项问题是否应该作为存储库中的问题引发?添加servlet-api对我的spring上下文没有任何功能差异,因此看起来这不应该是子上下文工厂的要求。