You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "conghuhu (via GitHub)" <gi...@apache.org> on 2023/04/25 05:45:29 UTC

[GitHub] [dubbo] conghuhu opened a new issue, #12186: SpringBoot的application.yaml配置中超过两层的没提示

conghuhu opened a new issue, #12186:
URL: https://github.com/apache/dubbo/issues/12186

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.2.0
   * Operating System version: Win11
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   ![image](https://user-images.githubusercontent.com/56248584/234184478-7ff845c5-4aa5-49ff-9f7a-7a47f59ad281.png)
   
   目测是dubbo的`@Nested`注解与spring的`@NestedConfigurationProperty`没有对齐
   ![image](https://user-images.githubusercontent.com/56248584/234184752-c8890297-3c66-483a-82be-105d7131e896.png)
   
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   
   If there is an exception, please attach the exception trace:
   
   ```
   Just put your stack trace here!
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "ShenFeng312 (via GitHub)" <gi...@apache.org>.
ShenFeng312 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1526908459

   分配给我吧


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1531508441

   > 需要手动生成一份配置文件的xml
   
   Springboot 的提示是基于 auto config 的吧


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "ShenFeng312 (via GitHub)" <gi...@apache.org>.
ShenFeng312 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1539489169

   > 这个可能是因为SpringBoot默认不会扫描非内部类的Config对象,如果需要被processor扫描到就需要有`@NestedConfigurationProperty`,并且是在每一个嵌套的对象想都要加上这个注解。 所以解决办法可能是:
   > 
   > 1. 在Dubbo有`@Nested`的地方加上`@NestedConfigurationProperty`, 目前会对dubbo-common有侵入性(要引入spring-boot 依赖)。
   > 2. 按照SpringBoot能正常处理的情况重新组织Configs , 比如都转成内部类...。
   > 3. 添加`META-INF/additional-spring-configuration-metadata.json` [Adding Additional Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#appendix.configuration-metadata.annotation-processor.adding-additional-metadata), 可能要手动维护。目前SpringBoot自己内部的`additional-spring-configuration-metadata.json` 比如`flyway`的,也是自己手动维护。
   > 
   > 如果把3自动化可能要基于`@Nested`去做自己的AnnotationProcessor,或者自己参考springboot的processor完全实现hits功能生成`spring-configuration-metadata.json`。
   
   是的 我的想法就是改代码自动生成一波 然后拷贝出来回滚代码 再自己润色一些注释之类的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "ShenFeng312 (via GitHub)" <gi...@apache.org>.
ShenFeng312 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1539487388

   > 这个可能是因为SpringBoot默认不会扫描非内部类的Config对象,如果需要被processor扫描到就需要有`@NestedConfigurationProperty`,并且是在每一个嵌套的对象想都要加上这个注解。 所以解决办法可能是:
   > 
   > 1. 在Dubbo有`@Nested`的地方加上`@NestedConfigurationProperty`, 目前会对dubbo-common有侵入性(要引入spring-boot 依赖)。
   > 2. 按照SpringBoot能正常处理的情况重新组织Configs , 比如都转成内部类...。
   > 3. 添加`META-INF/additional-spring-configuration-metadata.json` [Adding Additional Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#appendix.configuration-metadata.annotation-processor.adding-additional-metadata), 可能要手动维护。目前SpringBoot自己内部的`additional-spring-configuration-metadata.json` 比如`flyway`的,也是自己手动维护。
   > 
   > 如果把3自动化可能要基于`@Nested`去做自己的AnnotationProcessor,或者自己参考springboot的processor完全实现hits功能生成`spring-configuration-metadata.json`。
   是的 我的想法是手动改代码生成一波 copy 进去 后面就自己润色一些注释
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1521239885

   This is important


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "ShenFeng312 (via GitHub)" <gi...@apache.org>.
ShenFeng312 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1532354501

   > > 需要手动生成一份配置文件的xml
   > 
   > 
   > 
   > Springboot 的提示是基于 auto config 的吧
   
   spring-configuration-metadata.json 抱歉。说错了。是json文件。这个可以自动生成的


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] ShenFeng312 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "ShenFeng312 (via GitHub)" <gi...@apache.org>.
ShenFeng312 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1526924914

   需要手动生成一份配置文件的xml


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] Koooooo-7 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Posted by "Koooooo-7 (via GitHub)" <gi...@apache.org>.
Koooooo-7 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1537895388

   这个可能是因为SpringBoot默认不会扫描非内部类的Config对象,如果需要被processor扫描到就需要有`@NestedConfigurationProperty`,并且是在每一个嵌套的对象想都要加上这个注解。
   所以解决办法可能是:
   1. 在Dubbo有`@Nested`的地方加上`@NestedConfigurationProperty`, 目前会对dubbo-common有侵入性(要引入spring-boot 依赖)。
   
   2. 添加`META-INF/additional-spring-configuration-metadata.json` [Adding Additional Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#appendix.configuration-metadata.annotation-processor.adding-additional-metadata), 可能要手动维护。目前SpringBoot自己内部的`additional-spring-configuration-metadata.json` 比如`flyway`的,也是自己手动维护。
   
   如果把2自动化可能要基于`@Nested`去做自己的AnnotationProcessor,或者自己参考springboot的processor完全实现hits功能生成`spring-configuration-metadata.json`。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org