Open RobOhRob opened 3 years ago
Experiencing the same issues...
MappingJackson2XmlHttpMessageConverter is added to our resttemplate after including Azure Service Bus library...This is because Spring will add it to resttemplate when there exists an XmlMapper.class...
Issue still exists in the latest version(7.8.0)
@KnyGoo @RobOhRob Have you got any solution for this?
Issue still exists in the latest version(7.8.0)
@KnyGoo @RobOhRob Have you got any solution for this?
Exclude the jackson-dataformat-xml package from the service bus package in the gradle or pom
@RobOhRob What do you specifically mean when you mention "Exclude the jackson-dataformat-xml package from the service bus package in the gradle or pom" ? We have included only following in our gradle: implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.1.0' There's no specific dependency mentioned for jackson-dataformat-xml
Hey.
azure-messaging-servicebus depends on azure-core, which has a dependency on jackson-dataformat-xml
(https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/pom.xml#L114-L118).
The endpoints used by ServiceBusAdministrationClient and ServiceBusAdministrationAsyncClient return/consume XML. However, if you are not going to use those clients, you can exclude jackson-dataformat-xml.
I moved the bug to our repository. This repo references our legacy library.
We have already tried the exclusion option in following two ways:
compile (group: 'com.azure', name: 'azure-core', version: '1.18.0') { exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-xml' } And configurations.implementation { exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-xml' }
And then the application fails at the receiver startup.
@RobOhRob, @dhyanivikas : the problematic jackson xml library has been made an optional dependency. This should fix the issue. Please let us know if that is not the case.
i had the same problem. Thanks. These comments helped me
I am currently using Spring Boot version 2.1.3.RELEASE with version 7.1.0 of Azure service bus.
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.1.0'
Simply adding the line above to my build.gradle script alters default Spring Boot behavior. Hitting a GET endpoint without any Accept header specified is returning XML instead of JSON and creating a RestTemplate now has a bunch of different Accept types. This is causing existing legacy code to break. It appears to be an issue with all versions of azure-messaging-servicebus after it was moved to the new package.It appears that the issue is the
jackson-dataformat-xml
package that comes along with the jar. Excluding this package from the build returns to normal behavior. I am not sure if this is an issue with how you guys are packaging the library or if it is an issue with Spring just automatically consuming it.Actual Behavior
Expected Behavior
Versions
implementation group: 'com.azure', name: 'azure-messaging-servicebus', version: '7.1.0'