googleads / googleads-java-lib

Google Ad Manager SOAP API Client Library for Java
Apache License 2.0
226 stars 360 forks source link

NoClassDefFoundError issue #194

Closed GoogleAddssss closed 4 years ago

GoogleAddssss commented 4 years ago

I am using the below jars still i see issue running the code ads-lib-4.9.1 adwords-axis-4.9.1 google-oauth-client-1.30.0 commons-configuration-1.10 guava-20.0

Error message: Exception in thread "main" java.lang.NoClassDefFoundError: com/google/inject/Module at com.google.api.ads.adwords.lib.utils.AdWordsInternals.(AdWordsInternals.java:37) at com.google.api.ads.common.lib.auth.OfflineCredentials$Api.getInternals(OfflineCredentials.java:107) at com.google.api.ads.common.lib.auth.OfflineCredentials$Builder.defaultOptionals(OfflineCredentials.java:318) at com.google.api.ads.common.lib.auth.OfflineCredentials$Builder.forApi(OfflineCredentials.java:312) at AdWordsApi.main(AdWordsApi.java:39) Caused by: java.lang.ClassNotFoundException: com.google.inject.Module at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

GoogleAddssss commented 4 years ago

Anyone has any resolution on this one please?

nwbirnie commented 4 years ago

com.google.inject is the Guice module for dependency injection. You're missing quite a few dependencies compared to what's required to use the library.

The releases page on Github provides a downloadable tar.gz with all dependencies. All jars from the /adwords_axis/lib folder should be on your classpath. This includes guice-4.2.2.jar which is the source of the specific error you've encountered.

Do you mind if I ask which build system you're using? I'd like to know to ensure that we're providing an appropriate redistribution mechanism.

GoogleAddssss commented 4 years ago

I am using default build of the IntelliJ.

On Wed, Apr 22, 2020 at 11:20 PM Nick Birnie notifications@github.com wrote:

com.google.inject is the Guice module for dependency injection. You're missing quite a few dependencies compared to what's required to use the library.

The releases page on Github provides a downloadable tar.gz https://github.com/googleads/googleads-java-lib/releases/tag/4.9.1 with all dependencies. All jars from the /adwords_axis/lib folder should be on your classpath. This includes guice-4.2.2.jar which is the source of the specific error you've encountered.

Do you mind if I ask which build system you're using? I'd like to know to ensure that we're providing an appropriate redistribution mechanism.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/googleads/googleads-java-lib/issues/194#issuecomment-617932614, or unsubscribe https://github.com/notifications/unsubscribe-auth/APJCCFHNJVWO46SSVZQR32DRN4U75ANCNFSM4MNSCUJQ .