Azure dependency conflict with Jackson: java.lang.LinkageError: Package versions

Piotr Kwiatkowski 25 Reputation points
2023-07-24T14:36:35.47+00:00

I'm having troubles with introducing azure storage sdk into my Java project. There apparently are conflicts between various Jackson dependencies versions, but the odd thing is that all the dependencies being imported are of the same, up-to-date version.

The azure dependencies:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-sdk-bom</artifactId>
        <version>1.2.14</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
<dependencies>
    <dependency>
        <groupId>com.azure</groupId>
        <artifactId>azure-storage-blob</artifactId>
    </dependency>
...
</dependencies>

The code that triggers the problem:

BlobServiceClient blobServiceClient = new BlobServiceClientBuilder()
                .connectionString(connectionString)
                .buildClient();
blobServiceClient.createBlobContainer("hello-world-" + UUID.randomUUID());

The problem:

ERROR [com.azure.core.implementation.jackson.ObjectMapperShim] (reactor-http-nio-1) Package versions: jackson-core=2.12.6, jackson-databind=2.12.6-1, jackson-dataformat-xml=2.15.2, jackson-datatype-jsr310=2.12.6, azure-core=1.40.0, Troubleshooting version conflicts: https://aka.ms/azsdk/java/dependency/troubleshoot

The odd thing is that I do not import these 2.12.6 dependencies explicitly or in transitive way - I only use 2.15.2

Screenshot 2023-07-24 at 16.24.33

Full dependency tree: https://github.com/lrd2/working/blob/main/dependency_tree.txt

So any idea what causes the conflict and how to resolve it?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
{count} vote

Accepted answer
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2023-07-28T21:18:21.9333333+00:00

    Hi @Piotr Kwiatkowski ,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    The WildFly server where you deployed the application was causing an issue and overriding jackson dependencies configured in the app with predefined ones. This was triggering an error which stated that there were version conflicts, which initially seemed like they could be caused by an Azure dependency conflict with Jackson package versions.

    Solution:

    After replacing the predefined dependencies in the WildFly configuration, the problem disappeared and the Azure SDK created the blob container.

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    Please remember to "Accept the Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Piotr Kwiatkowski 25 Reputation points
    2023-07-24T19:45:17.8933333+00:00

    It was a WildFly server, to which I deployed the application, that caused the problem. It was overriding jackson dependencies configured in the app with predefined ones. After replacing them in WildFly configuration, the problem disappeared and the Azure SDK creates the blob container.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.