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









share|improve this question























  • 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














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









share|improve this question























  • 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












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









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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

















active

oldest

votes











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',
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
);



);













draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線