dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

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

Open suruns opened this issue 6 years ago • 8 comments

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.
  • [ ] I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.6.8
  • Operating System version: windows
  • Java version: 8

Steps to reproduce this issue

使用的版本 <properties> <java.version>1.8</java.version> <spring-boot.version>1.4.0.RELEASE</spring-boot.version> <spring.version>4.3.25.RELEASE</spring.version> <dubbo.version>2.6.8</dubbo.version> <dubbo.spring-boot.version>0.1.2.RELEASE</dubbo.spring-boot.version> <nacos.version>1.0.0</nacos.version> </properties> 配置信息: `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!

suruns avatar Aug 05 '20 06:08 suruns

referenceBean提前初始化问题

CodeIngL avatar Aug 07 '20 08:08 CodeIngL

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

CodeIngL avatar Aug 07 '20 08:08 CodeIngL

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

chickenlj avatar Aug 07 '20 08:08 chickenlj

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

chickenlj avatar Aug 07 '20 09:08 chickenlj

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

yuxiao97 avatar Aug 18 '20 08:08 yuxiao97

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

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

pkxiuluo avatar Aug 21 '20 09:08 pkxiuluo

  1. check your dependencies
<properties>
    <dubbo.version>2.7.8</dubbo.version>
</properties>
    
<dependencies>
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo</artifactId>
        <version>${dubbo.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo-dependencies-zookeeper</artifactId>
        <version>${dubbo.version}</version>
        <type>pom</type>
    </dependency>
</dependencies>
  1. check your configuration

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

dubbo.application.name=xx
...

afewnotes avatar Oct 29 '20 09:10 afewnotes

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

CrazyHZM avatar Oct 24 '21 01:10 CrazyHZM