apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.4k stars 26.42k forks source link

IllegalStateException: Invalid name="com.alibaba.dubbo.config.ApplicationConfig#0" contains illegal character #6554

Closed suruns closed 2 years ago

suruns commented 4 years ago

Environment

Steps to reproduce this issue

使用的版本 `

1.8 1.4.0.RELEASE 4.3.25.RELEASE 2.6.8 0.1.2.RELEASE 1.0.0 ` 配置信息: `spring: application: name: v5-ctp-organization dubbo: protocol: id: dubbo name: dubbo port: 20880 host: 10.6.5.117 application: name: ${spring.application.name} id: ${spring.application.name} registry: timeout: 3000 address: nacos://localhost:8888 username: nacos password: nacos id: ${spring.application.name}-registry` 启动报错 Caused by: java.lang.IllegalStateException: Invalid name="com.alibaba.dubbo.config.ApplicationConfig#0" contains illegal character, only digit, letter, '-', '_' or '.' is legal. at com.alibaba.dubbo.config.AbstractConfig.checkProperty(AbstractConfig.java:396) ~[dubbo-2.6.8.jar:2.6.8] at com.alibaba.dubbo.config.AbstractConfig.checkName(AbstractConfig.java:354) ~[dubbo-2.6.8.jar:2.6.8] at com.alibaba.dubbo.config.ApplicationConfig.setName(ApplicationConfig.java:99) ~[dubbo-2.6.8.jar:2.6.8] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_191] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_191] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_191] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_191] at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:216) ~[spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE] at com.alibaba.dubbo.config.spring.context.config.NamePropertyDefaultValueDubboConfigBeanCustomizer.customize(NamePropertyDefaultValueDubboConfigBeanCustomizer.java:65) ~[dubbo-2.6.8.jar:2.6.8] at com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor.customize(DubboConfigBindingBeanPostProcessor.java:109) ~[dubbo-2.6.8.jar:2.6.8] at com.alibaba.dubbo.config.spring.beans.factory.annotation.DubboConfigBindingBeanPostProcessor.postProcessBeforeInitialization(DubboConfigBindingBeanPostProcessor.java:91) ~[dubbo-2.6.8.jar:2.6.8] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] ... 15 common frames omitted Pls. provide [GitHub address] to reproduce this issue. ### Expected Result 正常启动 ### Actual Result 无法启动项目 If there is an exception, please attach the exception trace: ``` Just put your stack trace here! ```
CodeIngL commented 4 years ago

referenceBean提前初始化问题

CodeIngL commented 4 years ago

解决方式非常的简单,来参考https://github.com/open-wrapper/dubbo-wrapper

chickenlj commented 4 years ago

I remember this has been fixed in dubbo-spring-boot-starter

chickenlj commented 4 years ago

@mercyblitz would please hep to see which dubbo-boot version is compatible with 2.6.8 and has this bug fixed?

yuxiao97 commented 4 years ago

same issue contains illegal character, only digit, letter, '-', '_' or '.' is legal dubbo-spring-boot-starter:2.7.7

pkxiuluo commented 4 years ago

解决方式非常的简单,来参考https://github.com/open-wrapper/dubbo-wrapper

只有代码看不出怎么处理的

afewnotes commented 3 years ago
  1. check your dependencies
    
    <properties>
    <dubbo.version>2.7.8</dubbo.version>
    </properties>
org.apache.dubbo dubbo ${dubbo.version} org.apache.dubbo dubbo-dependencies-zookeeper ${dubbo.version} pom

2. [check your configuration ](http://dubbo.apache.org/en-us/docs/user/configuration/properties.html)

 **I fixed this problem by removing the old 'spring.' prefix**

```properties
dubbo.application.name=xx
...
CrazyHZM commented 2 years ago

Try it with the latest version, if you still have problems, you can reopen the issue