zrlw opened a new issue #8821:
URL: https://github.com/apache/dubbo/issues/8821


   ### Environment
   
   * Dubbo version:  3.0
   
   通常传给parseObject的raw config入参是yml格式的字符串,如下面日志所示:
   ```
   [16/09/21 02:16:21:021 UTC] ZookeeperDynamicConfiguration-thread-1  INFO 
integration.AbstractConfiguratorListener:  [DUBBO] Notification of overriding 
rule, change type is: MODIFIED, raw config content is:
    # Execute on governance-appoverride-provider.
   # This will take effect on all services in governance-appoverride-provider.
   ---
   configVersion: v2.7
   scope: application
   key: governance-appoverride-provider
   enabled: true
   configs:
   - addresses: ["0.0.0.0:20880"]
     side: provider
     parameters:
       weight: 0
   - addresses: ["0.0.0.0:20881"]
     side: provider
     parameters:
       weight: 100
   ..., dubbo version: 3.0.3-SNAPSHOT, current host: 172.21.0.3
   ```
   
   但有时传入的内容却是个IP地址串,如下面日志所示的"172.21.0.5",此时就会因为类型不一致而抛异常:
   ```
   [16/09/21 02:16:21:021 UTC] ZookeeperDynamicConfiguration-thread-1  INFO 
integration.AbstractConfiguratorListener:  [DUBBO] Notification of overriding 
rule, change type is: MODIFIED, raw config content is:
    172.21.0.5, dubbo version: 3.0.3-SNAPSHOT, current host: 172.21.0.4
   [16/09/21 02:16:21:021 UTC] ZookeeperDynamicConfiguration-thread-1 ERROR 
integration.AbstractConfiguratorListener:  [DUBBO] Failed to parse raw dynamic 
config and it will not take effect, the raw config is: 172.21.0.5, dubbo 
version: 3.0.3-SNAPSHOT, current host: 172.21.0.4
   java.lang.ClassCastException: java.lang.String cannot be cast to 
java.util.Map
        at 
org.apache.dubbo.rpc.cluster.configurator.parser.ConfigParser.parseObject(ConfigParser.java:76)
        at 
org.apache.dubbo.rpc.cluster.configurator.parser.ConfigParser.parseConfigurators(ConfigParser.java:51)
        at 
org.apache.dubbo.registry.integration.AbstractConfiguratorListener.genConfiguratorsFromRawRule(AbstractConfiguratorListener.java:107)
        at 
org.apache.dubbo.registry.integration.AbstractConfiguratorListener.process(AbstractConfiguratorListener.java:95)
        at 
org.apache.dubbo.configcenter.support.zookeeper.CacheListener.lambda$dataChanged$1(CacheListener.java:107)
        at 
java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:895)
        at 
java.util.concurrent.CopyOnWriteArraySet.forEach(CopyOnWriteArraySet.java:404)
        at 
org.apache.dubbo.configcenter.support.zookeeper.CacheListener.dataChanged(CacheListener.java:107)
        at 
org.apache.dubbo.remoting.zookeeper.curator.CuratorZookeeperClient$NodeCacheListenerImpl.nodeChanged(CuratorZookeeperClient.java:345)
        at 
org.apache.curator.framework.recipes.cache.NodeCache$4.apply(NodeCache.java:326)
        at 
org.apache.curator.framework.recipes.cache.NodeCache$4.apply(NodeCache.java:320)
        at 
org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:93)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to