You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.hippo4j.adapter.web.WebThreadPoolService' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:352)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:339)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1094)
at cn.hippo4j.common.config.ApplicationContextHolder.getBean(ApplicationContextHolder.java:47)
**at cn.hippo4j.adapter.web.WebThreadPoolHandlerChoose.choose(WebThreadPoolHandlerChoose.java:38)**
... 16 common frames omitted
背景
在SpringBoot 1.5.x版本当中, 关于Web容器的获取和操作的api, 与SpringBoot 2.x版本(目前Hippo4j使用的主要版本)完全不兼容.
因此需要针对SpringBoot1.5.x版本做一个特定版本的实现, 以便可以操作web容器当中的线程池.
目标
通过类设计方法, 抽象和复用公共部分, 将具体针对特定版本的实现, 沉淀到下层各自版本模块当中.
实际行为
1.5x版本和2.x版本关于WEB容器的操作接口不兼容,
cn.hippo4j.adapter.web.WebThreadPoolHandlerChoose.choose(WebThreadPoolHandlerChoose.java:38)
中获取实现类的时候报错.
解法
由于1.x已经开启一个定制化模块来进行适配(hippo4j-config-spring-boot-1x-starter), 将web容器的版本适配工作放在此模块当中.
其中, 类设计简化图示如下:
问题重现步骤
The text was updated successfully, but these errors were encountered: