title: Spark submit not working with Protobuf dependency
body: <p>Apache Spark: 3.0.0
  Protobuf: 3.5.1</p>
  <p>Exception:
  <code>&quot;main&quot; java.lang.NoSuchMethodError: com.google.protobuf.Descriptors$Descriptor.getOneofs()Ljava/util/List;</code></p>
  <p>Issue: When submitting my spake scala application on my local kubernetes, I am getting:
  <code>&quot;java.lang.NoSuchMethodError: com.google.protobuf.Descriptors$Descriptor.getOneofs()Ljava/util/List;&quot;</code></p>
  <p>Seems there is a conflict in dependency for Protobuff.</p>
  <p>Have tried a few things like <a href="https://github.com/nats-io/stan.java/issues/20" rel="nofollow noreferrer">https://github.com/nats-io/stan.java/issues/20</a> but nothing is working.</p>
  <p>my build.sbt:</p>
  <pre><code>name := &quot;test&quot;
  
  version := &quot;0.1&quot;
  scalaVersion := &quot;2.12.8&quot;
  
  val sparkVersion = &quot;3.0.0&quot;
  val protobufVersion = &quot;3.5.1&quot;
  
  resolvers += &quot;confluent&quot; at &quot;http://packages.confluent.io/maven/&quot;
  resolvers += Resolver.jcenterRepo
  resolvers += &quot;Spark Packages Repo&quot; at &quot;http://dl.bintray.com/spark-packages/maven&quot;
  
  assemblyMergeStrategy in assembly := {
    case &quot;META-INF/services/org.apache.spark.sql.sources.DataSourceRegister&quot; =&gt; MergeStrategy.concat
    case PathList(&quot;META-INF&quot;, xs@_*) =&gt; MergeStrategy.discard
    case &quot;application.conf&quot; =&gt; MergeStrategy.concat
    case x =&gt; MergeStrategy.first
  }
  
  assemblyShadeRules in assembly := Seq(
    ShadeRule.rename(&quot;com.google.protobuf.*&quot; -&gt; &quot;shadedproto.@1&quot;).inProject
      .inLibrary(&quot;com.google.protobuf&quot; % &quot;protobuf-java&quot; % protobufVersion)
  )
  
  coverageEnabled.in(ThisBuild, IntegrationTest, test) := true
  
  //skipping test cases during package
  test in assembly := {}
  
  lazy val server = (project in file(&quot;.&quot;))
    .configs(IntegrationTest)
    .settings(Defaults.itSettings)
  
  libraryDependencies ++= Seq(
    &quot;org.apache.spark&quot; %% &quot;spark-sql&quot; % sparkVersion % Provided,
    &quot;org.apache.spark&quot; %% &quot;spark-sql-kafka-0-10&quot; % sparkVersion,
    &quot;org.apache.kafka&quot; % &quot;kafka-clients&quot; % &quot;2.2.1&quot;,
    &quot;org.postgresql&quot; % &quot;postgresql&quot; % postgreSqlVersion,
    &quot;com.google.protobuf&quot; % &quot;protobuf-java&quot; % protobufVersion,
    &quot;com.typesafe&quot; % &quot;config&quot; % &quot;1.4.0&quot;
  )
  
  
  
  </code></pre>