Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Dependencies conflict building fat jar with com.microsoft.azure #62

@SolomonTomer

Description

@SolomonTomer

Hey,

Problem: building a fat jar results in a run time error of NoSuchMethod.

Details:

I'm using the SDK for Scala on Spark integration on HDI.
When I build a simple application creating a KeyVaultClient using ApplicationTokenCredentials object from com.microsoft.azure.credentials and run it locally everything works. Building a fat jar with mvn works but shows the following:

com.microsoft.azure:azure-keyvault:jar:1.1.1:compile
[INFO] +- com.microsoft.rest:client-runtime:jar:1.6.1:compile
[INFO] | +- (com.squareup.okhttp3:okhttp:jar:3.11.0:compile - omitted for conflict with 3.10.0)
[INFO] | +- com.squareup.okhttp3:logging-interceptor:jar:3.11.0:compile
[INFO] | | - (com.squareup.okhttp3:okhttp:jar:3.11.0:compile - omitted for duplicate)
[INFO] | - com.squareup.okhttp3:okhttp-urlconnection:jar:3.11.0:compile
[INFO] | - (com.squareup.okhttp3:okhttp:jar:3.11.0:compile - omitted for duplicate)
[INFO] +- com.squareup.retrofit2:retrofit:jar:2.4.0:compile
[INFO] | - (com.squareup.okhttp3:okhttp:jar:3.10.0:compile - omitted for conflict with 3.11.0)
[INFO] +- com.squareup.okhttp3:okhttp:jar:3.10.0:compile
[INFO] | - (com.squareup.okio:okio:jar:1.14.0:compile - omitted for duplicate)
[INFO] - com.squareup.okio:okio:jar:1.14.0:compile

Deploying the JAR to HDI and running it fails with the following trimmed stacktrace:

18/10/18 09:00:25 INFO ApplicationMaster: Final app status: FAILED, exitCode: 15, (reason: User class threw exception: java.lang.NoSuchMethodError: okio.BufferedSource.readUtf8LineStrict(J)Ljava/lang/String;
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:215)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)

My pom.xml contains spark dependencies and the following:

    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure</artifactId>
        <version>1.14.0</version>
    </dependency>
    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-keyvault</artifactId>
        <version>1.1.1</version>
    </dependency>

At this moment, as a work around I added this to my pom.xml file (before the two above) which forces the downgrade of azure-client that com.microsoft.azure uses (1.6):

    <dependency>
        <groupId>com.microsoft.rest</groupId>
        <artifactId>client-runtime</artifactId>
        <version>1.5.4</version>
    </dependency>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions