我正在Firestore上尝试POC。我已阅读Firebase文档并了解如何初始化,添加和读取数据。我已经设置了一个项目,并将以下依赖项添加到我的pom.xml中:
<dependencies>
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>6.6.0</version>
<exclusions>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/io.grpc/grpc-core -->
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-core</artifactId>
<version>1.14.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.3</version>
</dependency>
</dependencies>
firebase-admin引用了grpc-core版本1.13.1,而我的项目没有用它构建。因此排除了grpc-core并明确包含1.14.0版本。
这是示例POC代码:
@Component
public class FirestoreSynchronizer {
private static final Logger log = LogManager.getLogger(FirestoreSynchronizer.class);
private String projectId = "xxxxxxxxx";
private String serviceKeyFilePath = "xxxxxxxxx.json";
private Firestore db = null;
private int userIndex = 1;
@PostConstruct
public void initializeFirestore() {
log.debug("Entering initializeFirestore");
try {
InputStream serviceAccountFile = Thread.currentThread().getContextClassLoader().getResourceAsStream(serviceKeyFilePath);
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(GoogleCredentials.fromStream(serviceAccountFile))
.setProjectId(projectId)
.build();
FirebaseApp.initializeApp(options);
db = FirestoreClient.getFirestore();
}
catch (IOException e) {
log.error("Error in initializeFirestore", e);
}
log.debug("Leaving initializeFirestore");
}
public void addDataToFirestore(String collectionName, String docId, Object document) {
log.debug("addDataToFirestore with {}, {}, {}", collectionName, docId, document);
DocumentReference docRef = db.collection(collectionName).document(docId);
//asynchronously write data
ApiFuture<WriteResult> result = docRef.set(document);
// result.get() blocks on response
try {
System.out.println("Update time : " + result.get().getUpdateTime());
}
catch (Throwable t) {
log.error("Error in addDataToFirestore", t);
}
}
public Object readDataFromFirestore(String collectionName, String docId, Class objClass) {
log.debug("readDataFromFirestore with {}, {}, {}", collectionName, docId, objClass);
DocumentReference docRef = db.collection(collectionName).document(docId);
// asynchronously retrieve the document
ApiFuture<DocumentSnapshot> future = docRef.get();
// block on response
DocumentSnapshot document = null;
try {
document = future.get();
}
catch (Throwable t) {
log.error("Error in readDataFromFirestore", t);
}
Object obj = null;
if (document.exists()) {
// convert document to POJO
obj = document.toObject(objClass);
}
else {
log.debug("No document found for given Id : {}", docId);
}
return obj;
}
@Scheduled(cron="0 */2 * * * *" )
public void testFirebaseSync() {
User user = new User();
user.setUserId(userIndex);
user.setName("Name-" + userIndex);
user.setGender("F");
user.setCreationDate(new Date());
log.info("Saving user object to Firestore");
addDataToFirestore("User", String.valueOf(user.getUserId()), user);
log.info("Reading user object from Firestore");
readDataFromFirestore("User", String.valueOf(user.getUserId()), User.class);
userIndex++;
}
}
在Tomcat服务器中运行此命令时,在将数据添加到Firestore时看到以下错误:
2019-01-18 19:38:00,046 INFO [scheduler-1] [com.samples.firestore.FirestoreSynchronizer] - Saving user object to Firestore
2019-01-18 19:38:00,048 DEBUG [scheduler-1] [com.samples.firestore.FirestoreSynchronizer] - addDataToFirestore with User, 1, com.samples.firestore.User@6d192577
2019-01-18 19:38:00,277 ERROR [scheduler-1] [com.samples.firestore.FirestoreSynchronizer] - Error in addDataToFirestore
java.util.concurrent.ExecutionException: com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:500) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:479) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:76) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:62) ~[guava-20.0.jar:?]
at com.samples.firestore.FirestoreSynchronizer.addDataToFirestore(FirestoreSynchronizer.java:62) [firestorepoc-0.0.1-SNAPSHOT.jar:?]
at com.samples.firestore.FirestoreSynchronizer.testFirebaseSync(FirestoreSynchronizer.java:105) [firestorepoc-0.0.1-SNAPSHOT.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
Caused by: com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:67) ~[gax-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72) ~[gax-grpc-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60) ~[gax-grpc-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97) ~[gax-grpc-1.30.0.jar:1.30.0]
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68) ~[api-common-1.7.0.jar:?]
at com.google.common.util.concurrent.Futures$4.run(Futures.java:1123) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:675) ~[guava-20.0.jar:?]
at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:493) ~[grpc-stub-1.13.1.jar:1.13.1]
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:468) ~[grpc-stub-1.13.1.jar:1.13.1]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:403) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.14.0.jar:1.14.0]
... 7 more
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at io.grpc.Status.asRuntimeException(Status.java:526) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:468) ~[grpc-stub-1.13.1.jar:1.13.1]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:403) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.14.0.jar:1.14.0]
... 7 more
Caused by: java.lang.AbstractMethodError: io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(Ljava/net/SocketAddress;Lio/grpc/internal/ClientTransportFactory$ClientTransportOptions;)Lio/grpc/internal/ConnectionClientTransport;
at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:47) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:238) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:206) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$SubchannelImpl.requestConnection(ManagedChannelImpl.java:1417) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.PickFirstBalancerFactory$PickFirstBalancer.handleResolvedAddressGroups(PickFirstBalancerFactory.java:74) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.handleResolvedAddressGroups(AutoConfiguredLoadBalancerFactory.java:106) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl$1NamesResolved.run(ManagedChannelImpl.java:1286) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:73) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:1230) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:1290) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:251) ~[grpc-core-1.14.0.jar:1.14.0]
... 3 more
2019-01-18 19:38:00,288 INFO [scheduler-1] [com.samples.firestore.FirestoreSynchronizer] - Reading user object from Firestore
2019-01-18 19:38:00,297 DEBUG [scheduler-1] [com.samples.firestore.FirestoreSynchronizer] - readDataFromFirestore with User, 1, class com.samples.firestore.User
2019-01-18 19:38:00,329 ERROR [scheduler-1] [com.samples.firestore.FirestoreSynchronizer] - Error in readDataFromFirestore
java.util.concurrent.ExecutionException: com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:500) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:459) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:76) ~[guava-20.0.jar:?]
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:62) ~[guava-20.0.jar:?]
at com.samples.firestore.FirestoreSynchronizer.readDataFromFirestore(FirestoreSynchronizer.java:77) [firestorepoc-0.0.1-SNAPSHOT.jar:?]
at com.samples.firestore.FirestoreSynchronizer.testFirebaseSync(FirestoreSynchronizer.java:108) [firestorepoc-0.0.1-SNAPSHOT.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.1.2.RELEASE.jar:4.1.2.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_171]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_171]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_171]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_171]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_171]
Caused by: com.google.api.gax.rpc.InternalException: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:67) ~[gax-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72) ~[gax-grpc-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60) ~[gax-grpc-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.ExceptionResponseObserver.onErrorImpl(ExceptionResponseObserver.java:82) ~[gax-grpc-1.30.0.jar:1.30.0]
at com.google.api.gax.rpc.StateCheckingResponseObserver.onError(StateCheckingResponseObserver.java:86) ~[gax-1.30.0.jar:1.30.0]
at com.google.api.gax.grpc.GrpcDirectStreamController$ResponseObserverAdapter.onClose(GrpcDirectStreamController.java:149) ~[gax-grpc-1.30.0.jar:1.30.0]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:403) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.14.0.jar:1.14.0]
... 7 more
Caused by: io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at io.grpc.Status.asRuntimeException(Status.java:526) ~[grpc-core-1.14.0.jar:1.14.0]
at com.google.api.gax.grpc.GrpcDirectStreamController$ResponseObserverAdapter.onClose(GrpcDirectStreamController.java:149) ~[gax-grpc-1.30.0.jar:1.30.0]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:403) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:459) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:546) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:467) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:584) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.14.0.jar:1.14.0]
... 7 more
Caused by: java.lang.AbstractMethodError: io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder$NettyTransportFactory.newClientTransport(Ljava/net/SocketAddress;Lio/grpc/internal/ClientTransportFactory$ClientTransportOptions;)Lio/grpc/internal/ConnectionClientTransport;
at io.grpc.internal.CallCredentialsApplyingTransportFactory.newClientTransport(CallCredentialsApplyingTransportFactory.java:47) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:238) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.InternalSubchannel.obtainActiveTransport(InternalSubchannel.java:206) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$SubchannelImpl.requestConnection(ManagedChannelImpl.java:1417) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.PickFirstBalancerFactory$PickFirstBalancer.handleResolvedAddressGroups(PickFirstBalancerFactory.java:74) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.AutoConfiguredLoadBalancerFactory$AutoConfiguredLoadBalancer.handleResolvedAddressGroups(AutoConfiguredLoadBalancerFactory.java:106) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl$1NamesResolved.run(ManagedChannelImpl.java:1286) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ChannelExecutor.drain(ChannelExecutor.java:73) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$LbHelperImpl.runSerialized(ManagedChannelImpl.java:1230) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListenerImpl.onAddresses(ManagedChannelImpl.java:1290) ~[grpc-core-1.14.0.jar:1.14.0]
at io.grpc.internal.DnsNameResolver$1.run(DnsNameResolver.java:251) ~[grpc-core-1.14.0.jar:1.14.0]
... 3 more
如何解决此错误?