Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc library version clash between immudb4j and firebase SDK #60

Open
arturaz opened this issue Apr 18, 2024 · 3 comments
Open

grpc library version clash between immudb4j and firebase SDK #60

arturaz opened this issue Apr 18, 2024 · 3 comments

Comments

@arturaz
Copy link

arturaz commented Apr 18, 2024

[33/33] server.ivyDepsTree 
└─ io.grpc:grpc-api:1.55.1
   ├─ com.google.cloud:google-cloud-firestore:3.13.0
   │  └─ com.google.firebase:firebase-admin:9.2.0
   ├─ com.google.cloud:google-cloud-storage:2.22.4
   │  └─ com.google.firebase:firebase-admin:9.2.0
   ├─ io.grpc:grpc-core:1.55.1 io.grpc:grpc-api:[1.44.1] -> 1.55.1
   │  ├─ com.google.cloud:google-cloud-firestore:3.13.0
   │  │  └─ com.google.firebase:firebase-admin:9.2.0
   │  ├─ com.google.cloud:google-cloud-storage:2.22.4
   │  │  └─ com.google.firebase:firebase-admin:9.2.0
   │  └─ io.grpc:grpc-netty:1.44.1 io.grpc:grpc-core:[1.44.1] -> 1.55.1
   │     └─ io.codenotary:immudb4j:1.0.1
   ├─ io.grpc:grpc-protobuf:1.55.1
   │  ├─ com.google.cloud:google-cloud-firestore:3.13.0
   │  │  └─ com.google.firebase:firebase-admin:9.2.0
   │  ├─ com.google.cloud:google-cloud-storage:2.22.4
   │  │  └─ com.google.firebase:firebase-admin:9.2.0
   │  └─ io.codenotary:immudb4j:1.0.1 io.grpc:grpc-protobuf:1.44.1 -> 1.55.1
   ├─ io.grpc:grpc-protobuf-lite:1.55.1
   │  ├─ com.google.cloud:google-cloud-firestore:3.13.0
   │  │  └─ com.google.firebase:firebase-admin:9.2.0
   │  ├─ com.google.cloud:google-cloud-storage:2.22.4
   │  │  └─ com.google.firebase:firebase-admin:9.2.0
   │  └─ io.grpc:grpc-protobuf:1.55.1
   │     ├─ com.google.cloud:google-cloud-firestore:3.13.0
   │     │  └─ com.google.firebase:firebase-admin:9.2.0
   │     ├─ com.google.cloud:google-cloud-storage:2.22.4
   │     │  └─ com.google.firebase:firebase-admin:9.2.0
   │     └─ io.codenotary:immudb4j:1.0.1 io.grpc:grpc-protobuf:1.44.1 -> 1.55.1
   └─ io.grpc:grpc-stub:1.55.1
      ├─ com.google.cloud:google-cloud-firestore:3.13.0
      │  └─ com.google.firebase:firebase-admin:9.2.0
      ├─ com.google.cloud:google-cloud-storage:2.22.4
      │  └─ com.google.firebase:firebase-admin:9.2.0
      └─ io.codenotary:immudb4j:1.0.1 io.grpc:grpc-stub:1.44.1 -> 1.55.1

Which results in:

java.lang.IncompatibleClassChangeError: class io.grpc.xds.WeightedRoundRobinLoadBalancer cannot inherit from final class io.grpc.util.RoundRobinLoadBalancer
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373)
        at java.base/java.lang.Class.getConstructor0(Class.java:3578)
        at java.base/java.lang.Class.getConstructor(Class.java:2271)
        at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:666)
        at java.base/java.util.ServiceLoader$1.run(ServiceLoader.java:663)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
        at java.base/java.util.ServiceLoader.getConstructor(ServiceLoader.java:674)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1240)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
        at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
        at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
        at io.grpc.ServiceProviders.loadAll(ServiceProviders.java:67)
        at io.grpc.LoadBalancerRegistry.getDefaultRegistry(LoadBalancerRegistry.java:102)
        at io.grpc.internal.AutoConfiguredLoadBalancerFactory.<init>(AutoConfiguredLoadBalancerFactory.java:53)
        at io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:635)
        at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:630)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:297)
        at io.codenotary.immudb4j.ImmuClient.<init>(ImmuClient.java:91)
        at io.codenotary.immudb4j.ImmuClient.<init>(ImmuClient.java:66)
        at io.codenotary.immudb4j.ImmuClient$Builder.build(ImmuClient.java:2552)
        at app.storage.ImmuDB$.client$$anonfun$1(ImmuDB.scala:48)
        at cats.effect.IOFiber.runLoop(IOFiber.scala:1004)
        at cats.effect.IOFiber.execR(IOFiber.scala:1362)
        at cats.effect.IOFiber.run(IOFiber.scala:112)
        at cats.effect.unsafe.WorkerThread.run(WorkerThread.scala:702)
@arturaz
Copy link
Author

arturaz commented Apr 19, 2024

I was able to ./gradlew publishToMavenLocal by just changing the def grpcVersion to '1.55.1'.

@ostafen
Copy link
Contributor

ostafen commented Apr 19, 2024

So do you confirm that just updating the version to 1.55.1 solves the issue?

@arturaz: Could you please share a short snippet of code causing the issue that you described?

@arturaz
Copy link
Author

arturaz commented Apr 19, 2024

So do you confirm that just updating the version to 1.55.1 solves the issue?

@arturaz: Could you please share a short snippet of code causing the issue that you described?

Yes, recompiling the library against grpc 1.55.1 solves the issue.

Could you please share a short snippet of code causing the issue that you described?

  1. Have a project with these dependencies:
ivy"io.codenotary:immudb4j:1.0.1",
ivy"com.google.firebase:firebase-admin:9.2.0"
  1. Try to login to immudb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants