I've a proto file with syntax proto2
Also, I need to use Spark (2.0.2) and HBase. My project is built using Gradle.
Right now, when I run my Java code, I get this error:
Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 3.0 failed 1 times, most recent failure: Lost task 0.0 in stage 3.0 (TID 3, localhost): java.lang.NoSuchMethodError: com.google.protobuf.Descriptors$Descriptor.getOneofs()Ljava/util/List;
at com.google.protobuf.GeneratedMessageV3$FieldAccessorTable.<init>(GeneratedMessageV3.java:1707)
at com.google.protobuf.AnyProto.<clinit>(AnyProto.java:52)
at com.google.protobuf.Any.getDescriptor(Any.java:129)
at com.google.protobuf.util.JsonFormat$ParserImpl.buildWellKnownTypeParsers(JsonFormat.java:1100)
at com.google.protobuf.util.JsonFormat$ParserImpl.<clinit>(JsonFormat.java:1094)
at com.google.protobuf.util.JsonFormat$Parser.merge(JsonFormat.java:277)
This stacktrace is very similar to the issue posted here, but the resolution posted there didn't apply for me.
What I tried:
I changed
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '2.5.0'
to
compile group: 'org.spark-project.protobuf', name: 'protobuf-java', version: '2.4.1-shaded'
as that link suggested, but still, the same error persisted.
Any help is greatly appreciated!