0

On enabling class trace, found that WebSphere is loading other classes present in the same package (com.google.common.util.concurrent) from same guava-30.0-jre.jar

Total classes present in com.google.common.util.concurrent package: 310 and Total classes loaded: 285 (as per class load trace)

Solutions tried:

  1. Class load order is set to Parent Last
  2. Have also explicitly set jar path in Generic JVM Arguments under Application servers > server1 > Process definition > Java Virtual Machine
  3. Also tried creating a shared library and referencing it with the web app deployed. Steps followed to create shared library are from this URL
  4. JAR File is also okay and decompiling without any issue
  5. Machine Restart

Below is a stack trace for reference:

Caused by: java.lang.NoClassDefFoundError: com/google/common/util/concurrent/SettableFuture
at com.google.common.cache.LocalCache$LoadingValueReference.<init>(LocalCache.java:3472) ~[?:?]
at com.google.common.cache.LocalCache$LoadingValueReference.<init>(LocalCache.java:3476) ~[?:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2134) ~[?:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2045) ~[?:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3951) ~[?:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974) ~[?:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4935) ~[?:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4941) ~[?:?]
at com.google.inject.internal.Annotations$AnnotationChecker.hasAnnotations(Annotations.java:248) ~[guice-4.0.jar:?]
at com.google.inject.internal.Annotations.isBindingAnnotation(Annotations.java:314) ~[guice-4.0.jar:?]
at com.google.inject.internal.Annotations.findBindingAnnotation(Annotations.java:295) ~[guice-4.0.jar:?]
at com.google.inject.internal.ProviderMethodsModule.getKey(ProviderMethodsModule.java:280) ~[guice-4.0.jar:?]
at com.google.inject.internal.ProviderMethodsModule.createProviderMethod(ProviderMethodsModule.java:264) ~[guice-4.0.jar:?]
at com.google.inject.internal.ProviderMethodsModule.getProviderMethods(ProviderMethodsModule.java:144) ~[guice-4.0.jar:?]
at com.google.inject.internal.ProviderMethodsModule.configure(ProviderMethodsModule.java:123) ~[guice-4.0.jar:?]
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) ~[guice-4.0.jar:?]
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:349) ~[guice-4.0.jar:?]
at com.google.inject.spi.Elements.getElements(Elements.java:110) ~[guice-4.0.jar:?]
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138) ~[guice-4.0.jar:?]
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) ~[guice-4.0.jar:?]
at com.google.inject.Guice.createInjector(Guice.java:96) ~[guice-4.0.jar:?]
at com.google.inject.Guice.createInjector(Guice.java:73) ~[guice-4.0.jar:?]

Please note everything works fine when the same web app is deployed in WebLogic, Tomcat and JBoss

  • Can you share the stack of any nested "Caused by" exception? Usually a NoClassDefFoundError is caused by an underlying ClassNotFoundException, which will often have a stack that tells what class loader was used. – Jarid Apr 23 '21 at 13:57
  • The shared stack is the only one which is nested. After analyzing native_stderr.log file we found that only few of the classes from package com.google.common.util.concurrent are getting loaded and remaining classes are not, hence there is also no entry for them in the native_syserr.log file. Class loader used to load classes was CompoundClassLoader. For better understanding sharing complete stack trace in new edit. – Kumar Kundanani Apr 25 '21 at 09:02
  • @KumarKundanani: were you able to find a solution for this? – swap310 Oct 06 '21 at 23:46

1 Answers1

0

you may miss the InternalFutureFailureAccess.class and this is in another jar which named failureaccess-1.0.1.jar 。 check the jar or the InternalFutureFailureAccess.class is in your classpath.

IT-farmer
  • 1
  • 1