alibaba / nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
https://nacos.io
Apache License 2.0
30.29k stars 12.84k forks source link

The configuration file is normal in yml, but it is reported to nacos. #1700

Closed ylh23y closed 5 years ago

ylh23y commented 5 years ago

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

nacos-bot commented 5 years ago

Hi @ylh23y, we detect non-English characters in the issue. This comment is an auto translation from @nacos-bot to help other users to understand this issue. We encourage you to describe your issue in English which is more friendly to other users.

The configuration file is normal in yml, but it is reported to nacos.

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

ylh23y commented 5 years ago

image

freekry commented 5 years ago

@ylh23y Can you express it clearly?

ylh23y commented 5 years ago

搜狗截图20190816130040 搜狗截图20190816130132 我之前用的eureka和springcloud-config作为注册和配置中心,运行都是正常的,但是现在换成nacos,就报下面的错误: 2019-08-16 12:58:29.376 ERROR 10552 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Failed to bind properties under 'security.oauth2.client.client-secret' to java.lang.String:

Reason: Failed to bind properties under 'security.oauth2.client.client-secret' to java.lang.String

Action:

Update your application's configuration

Disconnected from the target VM, address: '127.0.0.1:63775', transport: 'socket'

Process finished with exit code 1 我用的版本是下面的:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
        <version>0.9.0.RELEASE</version>
    </dependency>
    <!--配置中心客户端-->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
        <version>0.9.0.RELEASE</version>
    </dependency>
ylh23y commented 5 years ago

问题找到了,配置文件里面有个@在nacos读不到:version: @project.version@,但是spring-cloud-config可以读到