Conflict between LEAF and MAP after upgrading spring-cloud-config-server
up vote
3
down vote
favorite
I'm using spring-cloud-config-server 1.2.2..RELEASE.
I need to update it to a newer version (e.g. 1.4.4..RELEASE, but the issue happens in the latest version as well)). When I tried to update the version and performed a call to the YAML endpoint of the config server (with test profile requested), I got an error (ClassCastException: java.lang.String cannot be cast to java.util.Map
) on some of my properties.
These properties are defined in application.yaml as a LEAF:
logging.level.com.company: DEBUG
But are defined as MAP on my application specific profile YAML (application-test.yaml):
logging.level.com.company.salesforce.editor.service: DEBUG
Previously, I got in the response YAML something like:
logging:
level:
com:
company: DEBUG
company.salesforce.editor.service: DEBUG
I debugged the spring-cloud-config-server code I found out there was a major change (from 1.2.x to 1.3.x) in
EnvironmentController.javaconvertToMap(Environment input, boolean resolvePlaceholders)()
that probably caused it.I found this GitHub issue on a similar issue:
ClassCastException with specific logging settings
But it wasn't helpful to me.
How can I use the new version, but get the same response as in the old version? If not possible, what is another course of action I can take?
EDIT
I've created a demo project to illustrate the problem - Clone it from here:
spring-cloud-config-server-demo
(It uses the following git backend for configurations: spring-cloud-config-server-configurations)
Once the demo server is up and running, query it like so:
curl http://localhost:8080/master/application-test.yaml
and you will get this error:
java.lang.String cannot be cast to java.util.Map
spring cloud spring-cloud-config
|
show 4 more comments
up vote
3
down vote
favorite
I'm using spring-cloud-config-server 1.2.2..RELEASE.
I need to update it to a newer version (e.g. 1.4.4..RELEASE, but the issue happens in the latest version as well)). When I tried to update the version and performed a call to the YAML endpoint of the config server (with test profile requested), I got an error (ClassCastException: java.lang.String cannot be cast to java.util.Map
) on some of my properties.
These properties are defined in application.yaml as a LEAF:
logging.level.com.company: DEBUG
But are defined as MAP on my application specific profile YAML (application-test.yaml):
logging.level.com.company.salesforce.editor.service: DEBUG
Previously, I got in the response YAML something like:
logging:
level:
com:
company: DEBUG
company.salesforce.editor.service: DEBUG
I debugged the spring-cloud-config-server code I found out there was a major change (from 1.2.x to 1.3.x) in
EnvironmentController.javaconvertToMap(Environment input, boolean resolvePlaceholders)()
that probably caused it.I found this GitHub issue on a similar issue:
ClassCastException with specific logging settings
But it wasn't helpful to me.
How can I use the new version, but get the same response as in the old version? If not possible, what is another course of action I can take?
EDIT
I've created a demo project to illustrate the problem - Clone it from here:
spring-cloud-config-server-demo
(It uses the following git backend for configurations: spring-cloud-config-server-configurations)
Once the demo server is up and running, query it like so:
curl http://localhost:8080/master/application-test.yaml
and you will get this error:
java.lang.String cannot be cast to java.util.Map
spring cloud spring-cloud-config
A question starting with "Does anyone know" is only answerable by "yes" or "no". Neither of these answers is going to be very helpful. And that is because that is not a question about programming (as appropriate for this site). Try to ask questions, for which the answer directly helps you, "How do I ...?", "How can I ... ?", that makes it much more clear what you really want to know.
– Anthon
Nov 11 at 15:03
OK, thanks for the correction.
– Eyal Ringort
Nov 12 at 6:09
We are no longer supporting 1.2.x or 1.3.x. You should be using 1.4.x or 2.0.x releases.
– Ryan Baxter
Nov 13 at 12:12
The issue happens in the latest versions as well - Edited the question
– Eyal Ringort
Nov 13 at 12:50
Please provide a sample to reproduce the issue
– Ryan Baxter
Nov 14 at 12:16
|
show 4 more comments
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm using spring-cloud-config-server 1.2.2..RELEASE.
I need to update it to a newer version (e.g. 1.4.4..RELEASE, but the issue happens in the latest version as well)). When I tried to update the version and performed a call to the YAML endpoint of the config server (with test profile requested), I got an error (ClassCastException: java.lang.String cannot be cast to java.util.Map
) on some of my properties.
These properties are defined in application.yaml as a LEAF:
logging.level.com.company: DEBUG
But are defined as MAP on my application specific profile YAML (application-test.yaml):
logging.level.com.company.salesforce.editor.service: DEBUG
Previously, I got in the response YAML something like:
logging:
level:
com:
company: DEBUG
company.salesforce.editor.service: DEBUG
I debugged the spring-cloud-config-server code I found out there was a major change (from 1.2.x to 1.3.x) in
EnvironmentController.javaconvertToMap(Environment input, boolean resolvePlaceholders)()
that probably caused it.I found this GitHub issue on a similar issue:
ClassCastException with specific logging settings
But it wasn't helpful to me.
How can I use the new version, but get the same response as in the old version? If not possible, what is another course of action I can take?
EDIT
I've created a demo project to illustrate the problem - Clone it from here:
spring-cloud-config-server-demo
(It uses the following git backend for configurations: spring-cloud-config-server-configurations)
Once the demo server is up and running, query it like so:
curl http://localhost:8080/master/application-test.yaml
and you will get this error:
java.lang.String cannot be cast to java.util.Map
spring cloud spring-cloud-config
I'm using spring-cloud-config-server 1.2.2..RELEASE.
I need to update it to a newer version (e.g. 1.4.4..RELEASE, but the issue happens in the latest version as well)). When I tried to update the version and performed a call to the YAML endpoint of the config server (with test profile requested), I got an error (ClassCastException: java.lang.String cannot be cast to java.util.Map
) on some of my properties.
These properties are defined in application.yaml as a LEAF:
logging.level.com.company: DEBUG
But are defined as MAP on my application specific profile YAML (application-test.yaml):
logging.level.com.company.salesforce.editor.service: DEBUG
Previously, I got in the response YAML something like:
logging:
level:
com:
company: DEBUG
company.salesforce.editor.service: DEBUG
I debugged the spring-cloud-config-server code I found out there was a major change (from 1.2.x to 1.3.x) in
EnvironmentController.javaconvertToMap(Environment input, boolean resolvePlaceholders)()
that probably caused it.I found this GitHub issue on a similar issue:
ClassCastException with specific logging settings
But it wasn't helpful to me.
How can I use the new version, but get the same response as in the old version? If not possible, what is another course of action I can take?
EDIT
I've created a demo project to illustrate the problem - Clone it from here:
spring-cloud-config-server-demo
(It uses the following git backend for configurations: spring-cloud-config-server-configurations)
Once the demo server is up and running, query it like so:
curl http://localhost:8080/master/application-test.yaml
and you will get this error:
java.lang.String cannot be cast to java.util.Map
spring cloud spring-cloud-config
spring cloud spring-cloud-config
edited Nov 15 at 7:40
asked Nov 11 at 14:40
Eyal Ringort
165
165
A question starting with "Does anyone know" is only answerable by "yes" or "no". Neither of these answers is going to be very helpful. And that is because that is not a question about programming (as appropriate for this site). Try to ask questions, for which the answer directly helps you, "How do I ...?", "How can I ... ?", that makes it much more clear what you really want to know.
– Anthon
Nov 11 at 15:03
OK, thanks for the correction.
– Eyal Ringort
Nov 12 at 6:09
We are no longer supporting 1.2.x or 1.3.x. You should be using 1.4.x or 2.0.x releases.
– Ryan Baxter
Nov 13 at 12:12
The issue happens in the latest versions as well - Edited the question
– Eyal Ringort
Nov 13 at 12:50
Please provide a sample to reproduce the issue
– Ryan Baxter
Nov 14 at 12:16
|
show 4 more comments
A question starting with "Does anyone know" is only answerable by "yes" or "no". Neither of these answers is going to be very helpful. And that is because that is not a question about programming (as appropriate for this site). Try to ask questions, for which the answer directly helps you, "How do I ...?", "How can I ... ?", that makes it much more clear what you really want to know.
– Anthon
Nov 11 at 15:03
OK, thanks for the correction.
– Eyal Ringort
Nov 12 at 6:09
We are no longer supporting 1.2.x or 1.3.x. You should be using 1.4.x or 2.0.x releases.
– Ryan Baxter
Nov 13 at 12:12
The issue happens in the latest versions as well - Edited the question
– Eyal Ringort
Nov 13 at 12:50
Please provide a sample to reproduce the issue
– Ryan Baxter
Nov 14 at 12:16
A question starting with "Does anyone know" is only answerable by "yes" or "no". Neither of these answers is going to be very helpful. And that is because that is not a question about programming (as appropriate for this site). Try to ask questions, for which the answer directly helps you, "How do I ...?", "How can I ... ?", that makes it much more clear what you really want to know.
– Anthon
Nov 11 at 15:03
A question starting with "Does anyone know" is only answerable by "yes" or "no". Neither of these answers is going to be very helpful. And that is because that is not a question about programming (as appropriate for this site). Try to ask questions, for which the answer directly helps you, "How do I ...?", "How can I ... ?", that makes it much more clear what you really want to know.
– Anthon
Nov 11 at 15:03
OK, thanks for the correction.
– Eyal Ringort
Nov 12 at 6:09
OK, thanks for the correction.
– Eyal Ringort
Nov 12 at 6:09
We are no longer supporting 1.2.x or 1.3.x. You should be using 1.4.x or 2.0.x releases.
– Ryan Baxter
Nov 13 at 12:12
We are no longer supporting 1.2.x or 1.3.x. You should be using 1.4.x or 2.0.x releases.
– Ryan Baxter
Nov 13 at 12:12
The issue happens in the latest versions as well - Edited the question
– Eyal Ringort
Nov 13 at 12:50
The issue happens in the latest versions as well - Edited the question
– Eyal Ringort
Nov 13 at 12:50
Please provide a sample to reproduce the issue
– Ryan Baxter
Nov 14 at 12:16
Please provide a sample to reproduce the issue
– Ryan Baxter
Nov 14 at 12:16
|
show 4 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f53249789%2fconflict-between-leaf-and-map-after-upgrading-spring-cloud-config-server%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
A question starting with "Does anyone know" is only answerable by "yes" or "no". Neither of these answers is going to be very helpful. And that is because that is not a question about programming (as appropriate for this site). Try to ask questions, for which the answer directly helps you, "How do I ...?", "How can I ... ?", that makes it much more clear what you really want to know.
– Anthon
Nov 11 at 15:03
OK, thanks for the correction.
– Eyal Ringort
Nov 12 at 6:09
We are no longer supporting 1.2.x or 1.3.x. You should be using 1.4.x or 2.0.x releases.
– Ryan Baxter
Nov 13 at 12:12
The issue happens in the latest versions as well - Edited the question
– Eyal Ringort
Nov 13 at 12:50
Please provide a sample to reproduce the issue
– Ryan Baxter
Nov 14 at 12:16