You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/14 06:23:04 UTC

[GitHub] [dubbo] chickenlj commented on issue #10102: dubbo3.0.8序列化问题

chickenlj commented on issue #10102:
URL: https://github.com/apache/dubbo/issues/10102#issuecomment-1154765757

   出现的主要问题是这个?
   ```java
   java.lang.NullPointerException: null
   at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:374)
   at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:361)
   at org.apache.dubbo.config.ServiceConfig.lambda$doDelayExport$0(ServiceConfig.java:243)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   at
   ```
   
   从代码分析来看 `ModuleServiceRepository repository = getScopeModel().getServiceRepository();` 并不会为空
   
   ```java
      public ModuleModel(ApplicationModel applicationModel, boolean isInternal) {
           super(applicationModel, ExtensionScope.MODULE, isInternal);
           Assert.notNull(applicationModel, "ApplicationModel can not be null");
           this.applicationModel = applicationModel;
           applicationModel.addModule(this, isInternal);
           if (LOGGER.isInfoEnabled()) {
               LOGGER.info(getDesc() + " is created");
           }
   
           initialize();
           Assert.notNull(serviceRepository, "ModuleServiceRepository can not be null");
           Assert.notNull(moduleConfigManager, "ModuleConfigManager can not be null");
           Assert.assertTrue(moduleConfigManager.isInitialized(), "ModuleConfigManager can not be initialized");
   
           // notify application check state
           ApplicationDeployer applicationDeployer = applicationModel.getDeployer();
           if (applicationDeployer != null) {
               applicationDeployer.notifyModuleChanged(this, DeployState.PENDING);
           }
       }
   ```
   
   **需要确认是否 Module 由于一些原因已经被销毁了** 
   ```java
       @Override
       protected void onDestroy() {
           // 1. remove from applicationModel
           applicationModel.removeModule(this);
   
           // 2. set stopping
           if (deployer != null) {
               deployer.preDestroy();
           }
   
           // 3. release services
           if (deployer != null) {
               deployer.postDestroy();
           }
   
           // destroy other resources
           notifyDestroy();
   
           if (serviceRepository != null) {
               serviceRepository.destroy();
               serviceRepository = null;
           }
   ```


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