【发布时间】:2020-04-24 12:15:24
【问题描述】:
当我尝试使用直接运行程序从 Apache Beam 调用我的 Spring 应用程序时,出现以下异常。
org.apache.beam.sdk.Pipeline$PipelineExecutionException:
java.lang.IllegalAccessError: class
io.grpc.internal.CensusTracingModule$TracingClientInterceptor tried to access
private field io.opencensus.trace.unsafe.ContextUtils.CONTEXT_SPAN_KEY
(io.grpc.internal.CensusTracingModule$TracingClientInterceptor and
io.opencensus.trace.unsafe.ContextUtils are in unnamed module of loader
java.net.URLClassLoader @72906e)
这行代码在微服务中。我创建了一个 jar 并在 Apache Beam 中添加了该依赖项。
这是导致错误的行:
ApiFuture<QuerySnapshot> future = firestore.collection("dev-project-tablename")
.whereEqualTo("key", key).get();
在 Apache Beam 中,我使用以下方法实例化了 Firestore 对象:
Firestore fireStore = FirestoreOptions.getDefaultInstance().getService();
【问题讨论】:
标签: google-cloud-platform google-cloud-firestore apache-beam java-11