<!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->

- [ ] 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.1.1
* Operating System version: macosx
* Java version: 17

### Steps to reproduce this issue
provider:
```
    <dubbo:protocol name="dubbo" serialization="fastjson2" port="20880"></dubbo:protocol>
    <dubbo:service protocol="dubbo" serialization="fastjson2" version="${dubbo.version:3.1.1}" loadbalance="roundrobin" interface="cn.app.service.TestService" timeout="50" registry="dubboRegistry"
                   ref="testService"/>
```
consumer:
The serialization method remains the same as hesian2
![image](https://user-images.githubusercontent.com/19943636/197732272-91b6260a-b23c-4e35-9ac1-980ce8bf75bd.png)
![image](https://user-images.githubusercontent.com/19943636/197732300-eb5fccec-0de0-4211-b240-a0fbd008c1ad.png)

Self-declared dubbo interfaces are normal
![image](https://user-images.githubusercontent.com/19943636/197733004-42fa2710-3ba3-4969-a302-b1706938c9e6.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!
```

RegistryConfig registryConfig = new RegistryConfig();
        registryConfig.setId("registryID_1");
        configManager.addRegistry(registryConfig);
        Optional<RegistryConfig> registryConfigOptional = configManager.getConfig(RegistryConfig.class, registryConfig.getId());
        Assertions.assertEquals(registryConfigOptional.get(), registryConfig);
        ProtocolConfig protocolConfig = new ProtocolConfig("dubbo");
        configManager.addProtocol(protocolConfig);
        Optional<ProtocolConfig> protocolConfigOptional = configManager.getConfig(ProtocolConfig.class, protocolConfig.getName());
        Assertions.assertEquals(protocolConfigOptional.get(), protocolConfig);
        
        ProtocolConfig protocolConfig2 = new ProtocolConfig("dubbo");
        protocolConfig2.setPort(9103);
        configManager.addProtocol(protocolConfig2);
        try {
            configManager.getConfig(ProtocolConfig.class, protocolConfig.getName());
            Assertions.fail();
        } catch (Exception e) {
            Assertions.assertTrue(e instanceof IllegalStateException);
            Assertions.assertEquals(e.getMessage(), "Found more than one config by name: dubbo, instances: " +
                "[<dubbo:protocol port=\"9103\" name=\"dubbo\" />, <dubbo:protocol name=\"dubbo\" />]. " +
                "Please remove redundant configs or get config by id.");
        }
        ModuleConfig moduleConfig = new ModuleConfig();
        moduleConfig.setId("moduleID_1");
        moduleConfigManager.setModule(moduleConfig);
        Optional<ModuleConfig> moduleConfigOptional = moduleConfigManager.getConfig(ModuleConfig.class, moduleConfig.getId());
        Assertions.assertEquals(moduleConfigOptional.get(), moduleConfig);
        Optional<RegistryConfig> config = moduleConfigManager.getConfig(RegistryConfig.class, registryConfig.getId());
        Assertions.assertEquals(config.get(), registryConfig);
    }