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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to