Cloud client config application do not get properties from Config Server Spring boot2019 Community Moderator ElectionHow to configure port for a Spring Boot applicationSpring Cloud Config Client Without Spring BootCan a Library jar read properties from Spring Cloud Config Server?Spring Boot application not connecting with Cloud Config Serverspring-cloud-config client not getting refreshed on property changeShare configuration between Spring cloud config clientsConfiguring Spring Boot with Spring-Cloud-Connectors to use the PWS Config-Serverspring-cloud-config client without starting a serverConfigure spring.* boot properties from cloud config serverSpring Boot Config Client is not fetching property from Config Server
Does the US political system, in principle, allow for a no-party system?
Boss Telling direct supervisor I snitched
How to install "rounded" brake pads
std::string vs const std::string& vs std::string_view
Short story about an infectious indestructible metal bar?
After Brexit, will the EU recognize British passports that are valid for more than ten years?
Should I file my taxes? No income, unemployed, but paid 2k in student loan interest
Is there a math expression equivalent to the conditional ternary operator?
Why aren't there more Gauls like Obelix?
How to educate team mate to take screenshots for bugs with out unwanted stuff
Why is there an extra space when I type "ls" on the Desktop?
Averaging over columns while ignoring zero entries
I am the light that shines in the dark
Can Witch Sight see through Mirror Image?
Why does a car's steering wheel get lighter with increasing speed
If nine coins are tossed, what is the probability that the number of heads is even?
I am the person who abides by rules but breaks the rules . Who am I
Does an unused member variable take up memory?
Can I frame a new window without adding jack studs?
Short story about cities being connected by a conveyor belt
What is the purpose of a disclaimer like "this is not legal advice"?
“I had a flat in the centre of town, but I didn’t like living there, so …”
Did Amazon pay $0 in taxes last year?
Inorganic chemistry handbook with reaction lists
Cloud client config application do not get properties from Config Server Spring boot
2019 Community Moderator ElectionHow to configure port for a Spring Boot applicationSpring Cloud Config Client Without Spring BootCan a Library jar read properties from Spring Cloud Config Server?Spring Boot application not connecting with Cloud Config Serverspring-cloud-config client not getting refreshed on property changeShare configuration between Spring cloud config clientsConfiguring Spring Boot with Spring-Cloud-Connectors to use the PWS Config-Serverspring-cloud-config client without starting a serverConfigure spring.* boot properties from cloud config serverSpring Boot Config Client is not fetching property from Config Server
I have a web application and I want to use Server Configuration from Spring Boot.
Both applications are located on localhost machine. I have made first two applications from scratch and they worked together, but when i use the client that has many dependencies in it (not just the cloud-config and web dependency) it is not working anymore. How do I know? I have a variable in properties file in server and i try to use it in my client with @Value("$atena")
and error appears java.lang.IllegalArgumentException: Could not resolve placeholder 'atena' in value "$atena".
The following image is my server config application.
The main class from server has the following annotation @EnableConfigServer
In atena-config.yml I have only the variable name:
atena: 'Hellllloooooo'
bootstrap.yml content
server:
port: 9000
spring:
profiles:
active: native
and build.gradle dependencies:
dependencies
implementation 'org.springframework.cloud:spring-cloud-config-server'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I am sure the server it is correct, something is wrong with my client.
--------------------> Client side
I have a restcontroller:
@RestController
@RequestMapping("/songs")
public class SongController
@Value("$atena")
String variable;
@GetMapping(value="/check-from")
public String viewVariable()
return variable;
in which I am trying to get the variable from server config.
bootstrap.yml from client
spring:
application:
name: atena-config
cloud:
config:
uri: http://localhost:9000
And lastly the build.gradle from client:
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter'
implementation('org.apache.tomcat:tomcat-jdbc:9.0.10')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation('org.mybatis:mybatis:3.4.6')
implementation('org.mybatis:mybatis-spring:1.3.2')
implementation('org.springframework.boot:spring-boot-starter-jdbc')
implementation('org.springframework.cloud:spring-cloud-starter-config')
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I really don't know what happen, I am pretty sure that these dependencies are the problem, but I have not figured out which one, i can not exclude any of them, because I am using them in project.
spring rest spring-boot build.gradle
add a comment |
I have a web application and I want to use Server Configuration from Spring Boot.
Both applications are located on localhost machine. I have made first two applications from scratch and they worked together, but when i use the client that has many dependencies in it (not just the cloud-config and web dependency) it is not working anymore. How do I know? I have a variable in properties file in server and i try to use it in my client with @Value("$atena")
and error appears java.lang.IllegalArgumentException: Could not resolve placeholder 'atena' in value "$atena".
The following image is my server config application.
The main class from server has the following annotation @EnableConfigServer
In atena-config.yml I have only the variable name:
atena: 'Hellllloooooo'
bootstrap.yml content
server:
port: 9000
spring:
profiles:
active: native
and build.gradle dependencies:
dependencies
implementation 'org.springframework.cloud:spring-cloud-config-server'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I am sure the server it is correct, something is wrong with my client.
--------------------> Client side
I have a restcontroller:
@RestController
@RequestMapping("/songs")
public class SongController
@Value("$atena")
String variable;
@GetMapping(value="/check-from")
public String viewVariable()
return variable;
in which I am trying to get the variable from server config.
bootstrap.yml from client
spring:
application:
name: atena-config
cloud:
config:
uri: http://localhost:9000
And lastly the build.gradle from client:
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter'
implementation('org.apache.tomcat:tomcat-jdbc:9.0.10')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation('org.mybatis:mybatis:3.4.6')
implementation('org.mybatis:mybatis-spring:1.3.2')
implementation('org.springframework.boot:spring-boot-starter-jdbc')
implementation('org.springframework.cloud:spring-cloud-starter-config')
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I really don't know what happen, I am pretty sure that these dependencies are the problem, but I have not figured out which one, i can not exclude any of them, because I am using them in project.
spring rest spring-boot build.gradle
add a comment |
I have a web application and I want to use Server Configuration from Spring Boot.
Both applications are located on localhost machine. I have made first two applications from scratch and they worked together, but when i use the client that has many dependencies in it (not just the cloud-config and web dependency) it is not working anymore. How do I know? I have a variable in properties file in server and i try to use it in my client with @Value("$atena")
and error appears java.lang.IllegalArgumentException: Could not resolve placeholder 'atena' in value "$atena".
The following image is my server config application.
The main class from server has the following annotation @EnableConfigServer
In atena-config.yml I have only the variable name:
atena: 'Hellllloooooo'
bootstrap.yml content
server:
port: 9000
spring:
profiles:
active: native
and build.gradle dependencies:
dependencies
implementation 'org.springframework.cloud:spring-cloud-config-server'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I am sure the server it is correct, something is wrong with my client.
--------------------> Client side
I have a restcontroller:
@RestController
@RequestMapping("/songs")
public class SongController
@Value("$atena")
String variable;
@GetMapping(value="/check-from")
public String viewVariable()
return variable;
in which I am trying to get the variable from server config.
bootstrap.yml from client
spring:
application:
name: atena-config
cloud:
config:
uri: http://localhost:9000
And lastly the build.gradle from client:
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter'
implementation('org.apache.tomcat:tomcat-jdbc:9.0.10')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation('org.mybatis:mybatis:3.4.6')
implementation('org.mybatis:mybatis-spring:1.3.2')
implementation('org.springframework.boot:spring-boot-starter-jdbc')
implementation('org.springframework.cloud:spring-cloud-starter-config')
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I really don't know what happen, I am pretty sure that these dependencies are the problem, but I have not figured out which one, i can not exclude any of them, because I am using them in project.
spring rest spring-boot build.gradle
I have a web application and I want to use Server Configuration from Spring Boot.
Both applications are located on localhost machine. I have made first two applications from scratch and they worked together, but when i use the client that has many dependencies in it (not just the cloud-config and web dependency) it is not working anymore. How do I know? I have a variable in properties file in server and i try to use it in my client with @Value("$atena")
and error appears java.lang.IllegalArgumentException: Could not resolve placeholder 'atena' in value "$atena".
The following image is my server config application.
The main class from server has the following annotation @EnableConfigServer
In atena-config.yml I have only the variable name:
atena: 'Hellllloooooo'
bootstrap.yml content
server:
port: 9000
spring:
profiles:
active: native
and build.gradle dependencies:
dependencies
implementation 'org.springframework.cloud:spring-cloud-config-server'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I am sure the server it is correct, something is wrong with my client.
--------------------> Client side
I have a restcontroller:
@RestController
@RequestMapping("/songs")
public class SongController
@Value("$atena")
String variable;
@GetMapping(value="/check-from")
public String viewVariable()
return variable;
in which I am trying to get the variable from server config.
bootstrap.yml from client
spring:
application:
name: atena-config
cloud:
config:
uri: http://localhost:9000
And lastly the build.gradle from client:
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter'
implementation('org.apache.tomcat:tomcat-jdbc:9.0.10')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation('org.mybatis:mybatis:3.4.6')
implementation('org.mybatis:mybatis-spring:1.3.2')
implementation('org.springframework.boot:spring-boot-starter-jdbc')
implementation('org.springframework.cloud:spring-cloud-starter-config')
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.5'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
I really don't know what happen, I am pretty sure that these dependencies are the problem, but I have not figured out which one, i can not exclude any of them, because I am using them in project.
spring rest spring-boot build.gradle
spring rest spring-boot build.gradle
edited 2 days ago
Oana-Elena Danescu
asked 2 days ago
Oana-Elena DanescuOana-Elena Danescu
257
257
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Never mind. I have fixed it. Indeed the problem was from my dependencies, my gradle.build was with problem. I have created a new project with spring initializer having all the dependencies and copied the new gradle.build from there and now is it working.
This is the new build.gradle from client
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
maven url 'https://repo.spring.io/milestone'
ext
set('springCloudVersion', 'Greenwich.RELEASE')
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.0'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
dependencyManagement
imports
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023251%2fcloud-client-config-application-do-not-get-properties-from-config-server-spring%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Never mind. I have fixed it. Indeed the problem was from my dependencies, my gradle.build was with problem. I have created a new project with spring initializer having all the dependencies and copied the new gradle.build from there and now is it working.
This is the new build.gradle from client
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
maven url 'https://repo.spring.io/milestone'
ext
set('springCloudVersion', 'Greenwich.RELEASE')
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.0'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
dependencyManagement
imports
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
add a comment |
Never mind. I have fixed it. Indeed the problem was from my dependencies, my gradle.build was with problem. I have created a new project with spring initializer having all the dependencies and copied the new gradle.build from there and now is it working.
This is the new build.gradle from client
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
maven url 'https://repo.spring.io/milestone'
ext
set('springCloudVersion', 'Greenwich.RELEASE')
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.0'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
dependencyManagement
imports
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
add a comment |
Never mind. I have fixed it. Indeed the problem was from my dependencies, my gradle.build was with problem. I have created a new project with spring initializer having all the dependencies and copied the new gradle.build from there and now is it working.
This is the new build.gradle from client
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
maven url 'https://repo.spring.io/milestone'
ext
set('springCloudVersion', 'Greenwich.RELEASE')
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.0'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
dependencyManagement
imports
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
Never mind. I have fixed it. Indeed the problem was from my dependencies, my gradle.build was with problem. I have created a new project with spring initializer having all the dependencies and copied the new gradle.build from there and now is it working.
This is the new build.gradle from client
plugins
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
apply plugin: 'io.spring.dependency-management'
group = 'com'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories
mavenCentral()
maven url 'https://repo.spring.io/milestone'
ext
set('springCloudVersion', 'Greenwich.RELEASE')
dependencies
compile 'com.google.apis:google-api-services-youtube:v3-rev206-1.25.0'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.0.0'
implementation 'org.springframework.cloud:spring-cloud-starter-config'
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
dependencyManagement
imports
mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
answered 2 days ago
Oana-Elena DanescuOana-Elena Danescu
257
257
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023251%2fcloud-client-config-application-do-not-get-properties-from-config-server-spring%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown