We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type: bug report @EnableNacosDiscovery 不生效,现象是:@import 注解的 NacosDiscoveryBeanDefinitionRegistrar 的 registerBeanDefinitions 方法 不能被执行, 服务注册发现失效
在我司的一个老项目中(javaweb)中,使用 https://nacos.io/zh-cn/docs/quick-start-spring.html 教程进行接入 nacos, 发现并不能如期进行服务注册和发现,且注入 NamingService 失败
期望在 spring 4.x 环境能支持 nacos-spring-context
Nacos 配置类
测试 Controller 类
nacos-spring-context:1.1.0 spring-core/context/web/webmvc:4.3.18.RELEASE
在发现这种情况的时候我进行了 debug 1.debug 确认了 NacosDiscoveryBeanDefinitionRegistrar 的 setEnvironment hook 方法是正常被调用 2.debug 确认了 NacosDiscoveryBeanDefinitionRegistrar 的 registerBeanDefinitions hook 方法是没有被调用 3.对第二点进行更进一步的 debug: ConfigurationClassParser 的 doProcessConfigurationClass 会对配置类的注解进行处理,里面包括扫描 @import 注解进行处理的逻辑。 跟进 doProcessConfigurationClass 方法 processImports 流程 的 getImports 方法 最后发现在对 @EnableNacosDiscovery 进行扫描内部注解时出现了异常,但是异常被 spring 忽略了,直接导致没有对 @import 注解进行相对应的处理。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue Description
Type: bug report
@EnableNacosDiscovery 不生效,现象是:@import 注解的 NacosDiscoveryBeanDefinitionRegistrar 的 registerBeanDefinitions 方法 不能被执行,
服务注册发现失效
Describe what happened (or what feature you want)
在我司的一个老项目中(javaweb)中,使用 https://nacos.io/zh-cn/docs/quick-start-spring.html 教程进行接入 nacos,

发现并不能如期进行服务注册和发现,且注入 NamingService 失败
Describe what you expected to happen
期望在 spring 4.x 环境能支持 nacos-spring-context
How to reproduce it (as minimally and precisely as possible)
Nacos 配置类

测试 Controller 类

Tell us your environment
nacos-spring-context:1.1.0
spring-core/context/web/webmvc:4.3.18.RELEASE
Anything else we need to know?
在发现这种情况的时候我进行了 debug




1.debug 确认了 NacosDiscoveryBeanDefinitionRegistrar 的 setEnvironment hook 方法是正常被调用
2.debug 确认了 NacosDiscoveryBeanDefinitionRegistrar 的 registerBeanDefinitions hook 方法是没有被调用
3.对第二点进行更进一步的 debug:
ConfigurationClassParser 的 doProcessConfigurationClass 会对配置类的注解进行处理,里面包括扫描 @import 注解进行处理的逻辑。
跟进 doProcessConfigurationClass 方法 processImports 流程 的 getImports 方法
最后发现在对 @EnableNacosDiscovery 进行扫描内部注解时出现了异常,但是异常被 spring 忽略了,直接导致没有对 @import 注解进行相对应的处理。
The text was updated successfully, but these errors were encountered: