title: ClassNotFoundException: io.opencensus.trace.propagation.TextFormat not found
body: <p>I have a module in apache karaf 4.2.6 with java 11 that validates purchase receipts in Google Play. I'm using androidpublisher.</p>
  
  <p>When it sends a request for the first time I get an error in OpenCensusUtils class:</p>
  
  <pre><code>androidPublisher.purchases().products().get(packageName, productId, purchaseToken).execute()
  </code></pre>
  
  <p><code>java.lang.ClassNotFoundException: io.opencensus.trace.propagation.TextFormat not found by wrap_file__Users_USER_NAME_.m2_repository_io_opencensus_opencensus-contrib-http-util_0.22.1_opencensus-contrib-http-util-0.22.1.jar</code></p>
  
  <p>In subsequent times I get error in com.google.api.client.http.HttpRequest class at this point <code>private final Tracer tracer = OpenCensusUtils.getTracer()</code>:</p>
  
  <p><code>java.lang.NoClassDefFoundError: Could not initialize class com.google.api.client.http.OpenCensusUtils</code></p>
  
  <p>Here is dependencies:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
          &lt;artifactId&gt;google-api-services-androidpublisher&lt;/artifactId&gt;
          &lt;version&gt;v3-rev92-1.25.0&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
                  &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.http-client&lt;/groupId&gt;
          &lt;artifactId&gt;google-http-client&lt;/artifactId&gt;
          &lt;version&gt;1.29.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;io.opencensus&lt;/groupId&gt;
          &lt;artifactId&gt;opencensus-api&lt;/artifactId&gt;
          &lt;version&gt;0.22.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.opencensus&lt;/groupId&gt;
          &lt;artifactId&gt;opencensus-contrib-http-util&lt;/artifactId&gt;
          &lt;version&gt;0.22.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Also <code>google-api-client</code>, <code>google-http-client-jackson2</code> and <code>google-oauth-client</code> has version 1.29.2</p>
  
  <p>In karaf I see the library <code>opencensus-api</code> is exporting a package   <code>io.opencensus.trace.propagation</code> that contains a class TextFormat.</p>
  
  <p>What am I doing wrong?</p>