You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by "mosinnik (via GitHub)" <gi...@apache.org> on 2026/07/14 22:43:44 UTC
[I] java.lang.ClassNotFoundException: com.google.common.collect.SingletonImmutableBiMap [fory]
mosinnik opened a new issue, #3847:
URL: https://github.com/apache/fory/issues/3847
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/fory/issues) and found no similar issues.
### Version
I have project with grpc-netty-shaded lib that depends on old guava 33.5.0-android which don't contain com.google.common.collect.SingletonImmutableBiMap. So it cause exception:
```
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.google.common.collect.SingletonImmutableBiMap
at org.apache.fory.serializer.collection.GuavaCollectionSerializers.loadClass(GuavaCollectionSerializers.java:713)
at org.apache.fory.serializer.collection.GuavaCollectionSerializers.registerDefaultSerializers(GuavaCollectionSerializers.java:632)
at org.apache.fory.resolver.ClassResolver.addDefaultSerializers(ClassResolver.java:384)
at org.apache.fory.resolver.ClassResolver.initialize(ClassResolver.java:331)
at org.apache.fory.Fory.<init>(Fory.java:155)
at org.apache.fory.config.ForyBuilder.newFory(ForyBuilder.java:740)
at org.apache.fory.config.ForyBuilder.lambda$factory$0(ForyBuilder.java:822)
at org.apache.fory.pool.ThreadPoolFory.lambda$new$0(ThreadPoolFory.java:64)
at org.apache.fory.pool.ThreadPoolFory.<init>(ThreadPoolFory.java:69)
at org.apache.fory.config.ForyBuilder.buildThreadSafeFory(ForyBuilder.java:774)
---
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.SingletonImmutableBiMap
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:547)
at org.apache.fory.serializer.collection.GuavaCollectionSerializers.loadClass(GuavaCollectionSerializers.java:711)
... 37 more
```
From dependency tree:
```
[INFO] +- io.grpc:grpc-netty-shaded:jar:1.79.0:runtime
[INFO] | +- io.grpc:grpc-util:jar:1.79.0:runtime
[INFO] | +- com.google.guava:guava:jar:33.5.0-android:compile
[INFO] | | +- com.google.guava:failureaccess:jar:1.0.3:compile
[INFO] | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | | \- com.google.j2objc:j2objc-annotations:jar:3.1:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.45.0:compile
[INFO] | +- io.perfmark:perfmark-api:jar:0.27.0:runtime
[INFO] | +- io.grpc:grpc-api:jar:1.79.0:compile
[INFO] | \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.26:compile
```
Fory: 1.3.0
Java25
### Component(s)
Java
### Minimal reproduce step
add to dependencies io.grpc:grpc-netty-shaded:jar:1.79.0 without any other guava in deps
### What did you expect to see?
Now in `GuavaCollectionSerializers` GUAVA_AVAILABLE calculated for only 6 classes, but in `registerDefaultSerializers` registered a bit more. So it must skip some loading or check each class existance
### What did you see instead?
exception
### Anything Else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org
Re: [I] java.lang.ClassNotFoundException on grpc shaded with guava-android in dependencies [fory]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang closed issue #3847: java.lang.ClassNotFoundException on grpc shaded with guava-android in dependencies
URL: https://github.com/apache/fory/issues/3847
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org