-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Azure Core 1.14.0 incompatible with Spring Boot 2.3/2.4 #19897
Comments
@alzimmermsft PTAL |
This could be an issue or pain point for the Spring users, @stliu suggested that we do some check in the JacksonAdapter to see whether Jackson 2.12 is on the classpath. And if so, we could then call this reflectively: this.xmlMapper.coercionConfigDefaults()
.setCoercion(CoercionInputShape.EmptyString, CoercionAction.AsNull); In this case, we'll not break the Spring users, and make sure the azure-core could work with both Jackson 2.12 and 2.11. Does this approach make sense to you? |
It's caused by a diverge of Jackson's version between azure-core and Spring bom. There's a workaround for this to add this property to your pom.xml: <properties>
<jackson-bom.version>2.12.1</jackson-bom.version>
</properties> In the meantime, we'll work with @alzimmermsft to see whether do we have a better approach here. |
@saragluna, yes, using reflective access makes sense to me for not introducing a breaking change. I'll look into this shortly. |
Seems to have fixed part of this issue but I am still seeing an error.
|
Needed to update to beta version in app config repo to see update. |
Describe the bug
Using any library that uses Azure Core 1.14.0 results in NoSuchMethodError when using Spring Boot.
Exception or Stack Trace
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.coercionConfigDefaults()Lcom/fasterxml/jackson/databind/cfg/MutableCoercionConfig;
at com.azure.core.util.serializer.JacksonAdapter.(JacksonAdapter.java:106)
at com.azure.core.util.serializer.JacksonAdapter.createDefaultSerializerAdapter(JacksonAdapter.java:139)
at com.azure.core.http.rest.RestProxy.createDefaultSerializer(RestProxy.java:585)
at com.azure.core.http.rest.RestProxy.create(RestProxy.java:637)
at com.azure.data.appconfiguration.ConfigurationAsyncClient.(ConfigurationAsyncClient.java:73)
at com.azure.data.appconfiguration.ConfigurationClientBuilder.buildAsyncClient(ConfigurationClientBuilder.java:205)
at hello.ApplicationRunnerTaskExecutor.run(ApplicationRunnerTaskExecutor.java:48)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:795)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:785)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:333)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298)
at hello.Application.main(Application.java:18)
... 6 more
To Reproduce
Code Snippet
Expected behavior
They should be compatible as azure-sdk-for-java has spring boot libraries in it.
Setup (please complete the following information):
Additional context
I was able to get it to work by overriding the Jackson libraries in my pom file, but not sure what side affects this may have, and shouldn't be required.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: