GSON Shading issue
Shading in OBM POM is too broad, and shades dependencies that are commonly used.
The issue was spotted with GSON dependency, during relocation group id changed from com.google
to shaded.com.google
.
But GSON is not bundled into the plugin JAR, consumers do not provide GSON as shaded.com.google
, causing ClassNotFoundException.
Caused by: java.lang.NoClassDefFoundError: shaded/com/google/gson/JsonSyntaxException
2024-04-12 15:32:22.538
... 35 common frames omitted
2024-04-12 15:32:22.538
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.checkLookupMethods(AutowiredAnnotationBeanPostProcessor.java:475)
2024-04-12 15:32:22.538
at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:320)
2024-04-12 15:32:22.538
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483)
2024-04-12 15:32:22.538
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.opengroup.osdu.core.obm.drivers.minio.MinioServices] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@5d6f64b1]
The issue was spotted during the dependency upgrade phase osdu/platform/system/storage!872 (merged)
GSON usage was added here !9 (merged)
Storage does have gson.dependency, but OBM-Minio requires shaded.gson.
Edited by Rustam Lotsmanenko (EPAM)