Created on 06-21-2022 11:09 PM - last edited on 06-22-2022 08:48 AM by VidyaSargur
Hi Team,
We are using guava-15.0.jar as part of cloudera-manager-api dependency version 6.3.0 in build.gradle file of cloudera-manager client module.
But while deploying it is giving the below error -
java.lang.NoClassDefFoundError: com/google/common/base/Objects$ToStringHelper
We faced the above error even with guava-30.0-jre.
I tried deploying by excluding the above guava jar but that again gave error -
Exception in thread \"main\" java.lang.NoClassDefFoundError: com/google/common/cache/CacheLoader
Please find below the build.gradle file dependencies-
dependencies {
compile group: 'com.cloudera.api', name: 'cloudera-manager-api', version:'6.3.0'
compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.7.21'
compile group: 'com.github.stefanbirkner', name: 'system-rules', version:'1.3.0'
compile group: 'org.eclipse.persistence', name: 'eclipselink', version:'2.4.2'
compile group: 'org.apache.cxf', name: 'cxf-rt-transports-http', version:'2.7.7'
compile group: 'org.json', name: 'json', version:'20140107'
Can you please suggest on what shall we do to resolve the above errors.
Regards,
Jessica Jindal
Created 07-04-2022 04:37 PM
Hi @Jessica_cisco can you try guava version 14.0.1 from the group com.google.guava?
compile group: 'com.google.guava', name: 'guava', version: '14.0.1'
You can add the above dependence in your build.gradle and try again?
Created 07-04-2022 10:51 PM
Hi @jagadeesan ,
The above error is resolved by added guava 19.0 jar.
But now i am facing some new error -
"Exception in thread \"main\" com.google.common.util.concurrent.UncheckedExecutionException: org.apache.cxf.bus.extension.ExtensionException: Could not load extension class org.apache.cxf.common.util.ASMHelperImpl.", "\tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)", "\tat com.google.common.cache.LocalCache.get(LocalCache.java:3932)", "\tat com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3936)", "\tat com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4806)", "\tat com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4812)", "\tat com.cloudera.api.ClouderaManagerClientBuilder.build(ClouderaManagerClientBuilder.java:272)", "\tat com.cloudera.api.ClouderaManagerClientBuilder.build(ClouderaManagerClientBuilder.java:252)", "\tat com.cisco.ivsg.cm.client.service.CmService.connect(CmService.java:395)", "\tat com.cisco.ivsg.cm.client.action.CmCommand.executeCommand(CmCommand.java:95)", "\tat com.cisco.ivsg.cm.client.action.CmCommand.main(CmCommand.java:83)", "Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not load extension class org.apache.cxf.common.util.ASMHelperImpl.", "\tat org.apache.cxf.bus.extension.Extension.tryClass(Extension.java:183)", "\tat org.apache.cxf.bus.extension.Extension.getClassObject(Extension.java:199)", "\tat org.apache.cxf.bus.extension.ExtensionManagerImpl.activateAllByType(ExtensionManagerImpl.java:139)", "\tat org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:145)", "\tat org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:151)", "\tat org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:40)", "\tat org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:36)", "\tat org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:32)", "\tat org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:107)", "\tat org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:243)", "\tat org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:227)", "\tat org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:214)", "\tat org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.getBus(JAXRSServiceFactoryBean.java:69)", "\tat org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.createResourceInfo(JAXRSServiceFactoryBean.java:202)", "\tat org.apache.cxf.jaxrs.JAXRSServiceFactoryBean.setResourceClass(JAXRSServiceFactoryBean.java:148)", "\tat org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.setServiceClass(JAXRSClientFactoryBean.java:171)", "\tat org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.setResourceClass(JAXRSClientFactoryBean.java:162)", "\tat com.cloudera.api.ClouderaManagerClientBuilder$1.load(ClouderaManagerClientBuilder.java:103)", "\tat com.cloudera.api.ClouderaManagerClientBuilder$1.load(ClouderaManagerClientBuilder.java:99)", "\tat com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3522)", "\tat com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2315)", "\tat com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2278)", "\tat com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2193)", "\t... 9 more", "Caused by: java.lang.IncompatibleClassChangeError: Implementing class", "\tat java.lang.ClassLoader.defineClass1(Native Method)", "\tat java.lang.ClassLoader.defineClass(ClassLoader.java:763)", "\tat java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)", "\tat java.net.URLClassLoader.defineClass(URLClassLoader.java:468)", "\tat java.net.URLClassLoader.access$100(URLClassLoader.java:74)", "\tat java.net.URLClassLoader$1.run(URLClassLoader.java:369)", "\tat java.net.URLClassLoader$1.run(URLClassLoader.java:363)", "\tat java.security.AccessController.doPrivileged(Native Method)", "\tat java.net.URLClassLoader.findClass(URLClassLoader.java:362)", "\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)", "\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)", "\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)", "\tat org.apache.cxf.bus.extension.Extension.tryClass(Extension.java:164)", "\t... 31 more"
Can you please help with this.
i am using cxf-rt-rs-client 3.4.4 and guava 19.0 version in build.gradle file.
Created 07-05-2022 05:31 PM
Hi @Jessica_cisco, it looks like conflicts in the versions/classes. Kindly locate duplicate dependencies and then clean rebuild again.
Created 07-05-2022 11:51 PM
Hi @jagadeesan,
I tried that as well, nothing worked.