You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "imgoby (via GitHub)" <gi...@apache.org> on 2025/09/02 02:34:18 UTC

[I] [Bug] moduleModel is null after native building [dubbo]

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

   ### Pre-check
   
   - [x] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
           <dubbo.version>3.3.1</dubbo.version>
   
   ### Steps to reproduce this issue
   
   1. build with  native
   
   2.run application:
   
   ```
   2025-09-02 09:35:43,006 ERROR [main] o.s.boot.SpringApplication [SpringApplication.java : 822] Application run failed
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dubboConfigBeanInitializer': Initialization dubbo config beans failed
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520)
           at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:331)
           at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:252)
           at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:329)
           at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201)
           at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973)
           at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:950)
           at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:614)
           at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
           at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
           at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
           at org.springframework.boot.SpringApplication.run(SpringApplication.java:310)
           at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:150)
           at com.hcll.sail.MessageProviderApplication.main(MessageProviderApplication.java:109)
   Caused by: org.springframework.beans.FatalBeanException: Initialization dubbo config beans failed
           at org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer.init(DubboConfigBeanInitializer.java:89)
           at org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer.afterPropertiesSet(DubboConfigBeanInitializer.java:77)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1817)
           at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766)
           ... 15 common frames omitted
   Caused by: java.lang.NullPointerException: null
           at org.apache.dubbo.config.spring.reference.ReferenceBeanManager.initReferenceBean(ReferenceBeanManager.java:208)
           at org.apache.dubbo.config.spring.reference.ReferenceBeanManager.prepareReferenceBeans(ReferenceBeanManager.java:165)
           at org.apache.dubbo.config.spring.context.DubboConfigBeanInitializer.init(DubboConfigBeanInitializer.java:87)
           ... 18 common frames omitted
   2025-09-02 09:36:51,105 INFO [background-preinit] o.h.validator.internal.util.Version [Version.java : 21] HV000001: Hibernate Validator 8.0.1.Final
   2025-09-02 09:36:51,281 INFO [main] o.a.d.s.b.c.e.WelcomeLogoApplicationListener [Log4j2Logger.java : 71]  [DUBBO]
   ```
   
   
   ### What you expected to happen
   
   NullPointerException was found.I expect it normally
   
   ### Anything else
   
   I should add this code to fix it:
   
   <img width="810" height="285" alt="Image" src="https://github.com/user-attachments/assets/0842c025-9bcf-4f9b-9621-491bc32b1c05" />
   
   
               //fix bug,在native下moduleModel为null
               if (moduleModel == null) {
                   moduleModel = DubboBeanUtils.getModuleModel(applicationContext);
               }
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   > > prepareReferenceBeans
   > 
   > OK,this solution by moving to prepareReferenceBeans will be tried later.
   
   any progress? @imgoby 


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   could you debug or add log info at ReferenceBeanManager#setApplicationContext to check the moduleModel value?
   ```
       @Override
       public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
           this.applicationContext = applicationContext;
           moduleModel = DubboBeanUtils.getModuleModel(applicationContext); 
           <=== debug or log info of moduleModel's value at 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

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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   @imgoby could you check whether https://github.com/apache/dubbo/pull/15721 fixs this issue or not?


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

Posted by "wangchengming666 (via GitHub)" <gi...@apache.org>.
wangchengming666 closed issue #15663: [Bug] moduleModel is null after native building
URL: https://github.com/apache/dubbo/issues/15663


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   > prepareReferenceBeans
   
   OK,this solution by moving to prepareReferenceBeans will be tried later.


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   > I hope you can find the root cause and best way.
   
   ```moduleModel``` might not be created at ```ReferenceBeanManager#setApplicationContext```.


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   @zrlw @imgoby 
   I’d like to work on this. Could you please assign it to me?


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   > could you debug or add log info at ReferenceBeanManager#setApplicationContext to check the moduleModel value?
   
   Yes, I have added logs at this point, and that value is null. I spent a long time investigating this null value, and eventually had no choice but to add a fix at the end. Although this fix may not be the best solution, it has resolved the issue for now. I hope you can find the root cause and best way.


-- 
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


Re: [I] [Bug] moduleModel is null after native building [dubbo]

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

   Thanks for opening this issue! I'm interested in contributing to this. 👋
   
   ## 🤔 Understanding the Requirements
   
   To provide the best solution, I'd like to understand:
   
   **Context:**
   - What's the current behavior?
   - What's the expected/desired behavior?
   - What's the impact or use case?
   
   **Scope:**
   - Are there any specific requirements or constraints?
   - Any preferences for implementation approach?
   - Related issues or PRs?
   
   **Success Criteria:**
   - What would "done" look like for this issue?
   - Any specific metrics or tests needed?
   
   ## 💪 How I Can Help
   
   I have experience with apache projects and can contribute:
   
   - 🔍 **Investigation**: Research and propose solutions
   - 💻 **Implementation**: Write clean, tested code
   - ✅ **Testing**: Comprehensive test coverage
   - 📚 **Documentation**: Clear docs and examples
   - 👀 **Review**: Iterate based on feedback
   
   ## 🚀 My Approach
   
   1. Understand requirements thoroughly
   2. Research best practices and similar solutions
   3. Design before implementing
   4. Write tests first (TDD)
   5. Implement incrementally
   6. Document clearly
   7. Iterate based on review
   
   Let me know if this is still open and how I can help! I'm excited to contribute. 🎯
   
   **My relevant experience:**
   - Similar projects and features
   - Modern development practices
   - Open source contribution
   - Production system experience
   
   Feel free to assign this to me if you'd like me to work on it! 🙌


-- 
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