SFS2X Guava Version seems too Old for Google Pubsub
Posted: 01 Aug 2019, 08:31
Hi, we are trying to integrate Google Pubsub into our SFS2X game backend.
However, we find the following error, which implies that the Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object) method, provided by Guava and called by Pubsub library, can’t be found.
After executing the following log command
We know that the Preconditions.class is located on
To further confirm this speculation, we had tried to manually replace the Jar of Guava in the SFS2X/lib, from guava-18.0.jar to gruava-28.0.jar.
And everything works.
However, considering changing the jar SFS2X depends on might cause unexpected trouble, we don’t tend to adopt such workaround.
We had also tried to downgrade the Pubsub library, but it seems that none of them can be adapted to Guava 18.0.
Any suggestion for this issue?
Thanks in advance!
However, we find the following error, which implies that the Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object) method, provided by Guava and called by Pubsub library, can’t be found.
Code: Select all
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;CLjava/lang/Object;)V
at io.grpc.Metadata$Key.validateName(Metadata.java:628)
at io.grpc.Metadata$Key.<init>(Metadata.java:636)
at io.grpc.Metadata$Key.<init>(Metadata.java:566)
at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:740)
at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:735)
at io.grpc.Metadata$Key.of(Metadata.java:592)
at io.grpc.Metadata$Key.of(Metadata.java:588)
at com.google.api.gax.grpc.GrpcHeaderInterceptor.<init>(GrpcHeaderInterceptor.java:61)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:173)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:162)
at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:149)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:157)
at com.google.cloud.pubsub.v1.stub.GrpcPublisherStub.create(GrpcPublisherStub.java:161)
at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:154)
at com.google.cloud.pubsub.v1.Publisher.<init>(Publisher.java:83)
at com.google.cloud.pubsub.v1.Publisher$Builder.build(Publisher.java:607)
at com.mydomain.myproject.lobby.pubsub.publisher.EventLogPublisher._createGcpPublisher(EventLogPublisher.java:86)
at com.mydomain.myproject.lobby.pubsub.publisher.EventLogPublisher.<init>(EventLogPublisher.java:40)
at com.mydomain.myproject.lobby.pubsub.publisher.EventLogPublisher.<clinit>(EventLogPublisher.java:29)
at com.mydomain.myproject.lobby.pubsub.template.EventLog.queueForPublish(EventLog.java:27)
at com.mydomain.myproject.lobby.utils.CCULogger.sampleCCU(CCULogger.java:51)
at com.mydomain.myproject.lobby.utils.CCULogger.init(CCULogger.java:27)
at com.mydomain.myproject.lobby.lobbyserver.LobbyServerMainExtensionDelegate.initManagers(LobbyServerMainExtensionDelegate.java:117)
at com.mydomain.myproject.lobby.lobbyserver.LobbyServerMainExtensionDelegate.startWorld(LobbyServerMainExtensionDelegate.java:78)
at com.mydomain.myproject.lobby.lobbyserver.LobbyServerMainExtensionDelegate.init(LobbyServerMainExtensionDelegate.java:61)
at com.mydomain.myproject.lobby.BaseZoneExtension.init(BaseZoneExtension.java:31)
at com.mydomain.myproject.lobby.lobbyserver.LobbyServerMainExtension.init(LobbyServerMainExtension.java:12)
at com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:303)
at com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:426)
at com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:239)
at com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:297)
at com.smartfoxserver.v2.Main.main(Main.java:14)
Code: Select all
Class klass = Preconditions.class;
URL location = klass.getResource('/' + klass.getName().replace('.', '/') + ".class");
System.out.println(location);
Code: Select all
jar:file:/opt/SmartFoxServer_2X/SFS2X/lib/guava-18.0.jar!/com/google/common/base/Preconditions.class
And everything works.
However, considering changing the jar SFS2X depends on might cause unexpected trouble, we don’t tend to adopt such workaround.
We had also tried to downgrade the Pubsub library, but it seems that none of them can be adapted to Guava 18.0.
Any suggestion for this issue?
Thanks in advance!