Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-9304

beam-sdks-java-io-google-cloud-platform imports conflicting versions for BigTable and Spanner

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P1
    • Resolution: Fixed
    • Affects Version/s: 2.18.0
    • Fix Version/s: 2.20.0
    • Component/s: io-java-gcp
    • Labels:
      None

      Description

      If I include `beam-sdks-java-io-google-cloud-platform` version 2.18.0 in a project and try to use `SpannerIO`, the exception `java.lang.NoClassDefFoundError: io/opencensus/trace/Tracestate`. This seems to be caused by conflicting versions of `io.opencensus:opencensus-api` being included by the BigTable client and the Spanner client. BigTable imports version 0.15.0. Spanner depends on 0.18.0, but as they are at the same level in the dependency tree and BigTable is defined first, version 0.15.0 is used.

       

      The workaround for this issue is to exclude the BigTable client in the project pom in order to be able to use SpannerIO.

       

      An example pom and simple Java class are included. If the commented exclusion of the BigTable client is removed, the example will run without problems. The example will also run without problems on Beam version 2.17 without the exclusion.

       

        Attachments

        1. pom.xml
          1 kB
          Knut Olav Loite
        2. SpannerRead.java
          3 kB
          Knut Olav Loite

          Activity

            People

            • Assignee:
              chamikara Chamikara Madhusanka Jayalath
              Reporter:
              koloite Knut Olav Loite
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: