title: java.lang.NoClassDefFoundError: Could not initialize class okhttp3.OkHttpClient
body: <p>As part of solving GIT vulnerability issue, i upgraded splunk-library-javalogging from 1.7.0 to 1.11.1.</p>
  <p>But when i deployed this to my k8s cluster i am getting error like
  java.lang.NoClassDefFoundError: Could not initialize class okhttp3.OkHttpClient</p>
  <p>I changed my deployment version to previous one, then it works fine. Not sure why changing version to 1.11.1 gives me this error</p>
  <p>This is working</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.splunk.logging&lt;/groupId&gt;
      &lt;artifactId&gt;splunk-library-javalogging&lt;/artifactId&gt;
      &lt;version&gt;1.7.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>Below is not working</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.splunk.logging&lt;/groupId&gt;
      &lt;artifactId&gt;splunk-library-javalogging&lt;/artifactId&gt;
      &lt;version&gt;1.11.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>And i have to upgrade to 1.11.1 or higher to resolve GIT vulnerability issue. I have read many solutions but i did not find any answer helpful. This is a maven project and i am running it on java 8.</p>
  <p>Also, running jar file in my local doesn't give the error. Issue is only in k8s cluster</p>
  <p>Update 4th Mar 2022
  i explicitly declared  version after reading some solution on the internet like below</p>
  <pre><code>&lt;mockwebserver.version&gt;4.7.2&lt;/mockwebserver.version&gt;
  &lt;okhttp3.version&gt;4.7.2&lt;/okhttp3.version&gt;
  </code></pre>
  <p>But now i am getting slighly different error<br />
  org.springframework.boot.SpringApplication|Application run failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'okHttpClientBuilder' defined in class path resource [org/springframework/cloud/commons/httpclient/HttpClientConfiguration$OkHttpClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [okhttp3.OkHttpClient$Builder]: Factory method 'okHttpClientBuilder' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class okhttp3.internal.Util</p>
  <p>Earlier error was
  org.springframework.boot.SpringApplication|Application run failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'okHttpClientBuilder' defined in class path resource [org/springframework/cloud/commons/httpclient/HttpClientConfiguration$OkHttpClientConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [okhttp3.OkHttpClient$Builder]: Factory method 'okHttpClientBuilder' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class okhttp3.OkHttpClient</p>