ExceptionInInitializerError

264 views
Skip to first unread message

The Phantom

unread,
Jul 30, 2015, 9:30:49 AM7/30/15
to AdWords API Forum
I am working with the Google AdWords API v201502 and using OAuth2 credentials via the OfflineCredentials.Builder() method.

After obtaining authorization, I attempt to create and AdWordsServices object via:

AdWordsServices adWordsServices = new AdWordsServices();

At this point, I am seeing the following:

java.lang.ExceptionInInitializerError
Caused by: com.google.inject.CreationException: Guice creation errors:
1) No implementation for com.google.api.ads.common.lib.client.HeaderHandler<com.google.api.ads.adwords.lib.client.AdWordsSession, com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor> annotated with @com.google.inject.multibindings.Element(setName=, uniqueId=2, type=MAPBINDER) was bound.
  while locating com.google.api.ads.common.lib.client.HeaderHandler<com.google.api.ads.adwords.lib.client.AdWordsSession, com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor> annotated with @com.google.inject.multibindings.Element(setName=, uniqueId=2, type=MAPBINDER)
  at com.google.inject.multibindings.MapBinder$RealMapBinder$1.initialize(MapBinder.java:380)
  at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:48)
2) No implementation for java.lang.String annotated with @com.google.inject.multibindings.Element(setName=, uniqueId=6, type=MAPBINDER) was bound.
  while locating java.lang.String annotated with @com.google.inject.multibindings.Element(setName=, uniqueId=6, type=MAPBINDER)
  at com.google.inject.multibindings.MapBinder$RealMapBinder$1.initialize(MapBinder.java:380)
  at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:57)
2 errors
 at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:416)
 at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:188)
 at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:122)
 at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:100)
 at com.google.inject.Guice.createInjector(Guice.java:95)
 at com.google.inject.Guice.createInjector(Guice.java:72)
 at com.google.inject.Guice.createInjector(Guice.java:61)
 at com.google.api.ads.adwords.axis.factory.AdWordsServices.<clinit>(AdWordsServices.java:46)

I am using the following jars:

Slf4j-api-1.7.7.jar   
Guice-4.0-beta4.jar   
Google-oauth-client-1.19.0.jar 
Log4j-1.2.17.jar  
Commons-logging-1.1.1.jar  
Commons-lang-2.3.jar  
Springframework-2.5.6.jar  
Axis-1.4.jar  
Google-http-client-1.20.0.jar  
Slf4j-log4j12-1.7.5.jar  
Ads-lib-axis-1.32.0.jar  
Adwords-axis-1.38.0.jar 
Ads-lib-2.1.0.jar  
Guava-15.0-cdi1.0.jar  
Commons-beanutils-1.9.2.jar  
Commons-discovery-0.4.jar 
Jaxrpc-api-1.1.jar  
Guice-assistedinject-4.0.jar  
Guice-multibindings-4.0-beta4.jar 
Inject-11.1.2.3.0.jar  
Commons-configuration-1.8.jar 
Jackson-core-2.6.0-rc2.jar 
Guice-3.0-rc1.jar  
Google-http-client-jackson2-1.18.0-rc.jar 
Google-api-client-1.18.0-rc.jar 

I'm thinking that somewhere there is a mismatch between jars, but haven't been able to track it down yet. 

Can someone please help?

Thanks.

The Phantom

unread,
Jul 30, 2015, 1:11:03 PM7/30/15
to AdWords API Forum, beama...@gmail.com
Since the original posting, I have replaced Google-api-client-1.18.0-rc.jar with Google-api-client-1.20.0.jar and the problem still persists.
 

Anthony Madrigal

unread,
Jul 30, 2015, 2:50:19 PM7/30/15
to AdWords API Forum, beama...@gmail.com, beama...@gmail.com
Hello,

We recently released AdWords API v201506, which can be downloaded using one of our client libraries. Try to see if downloading the new version still gives you that error. 

If you are still running into issues, can you please reply privately to author your SOAP XML request and response?

Regards,
Anthony
AdWords API Team

The Phantom

unread,
Jul 31, 2015, 12:17:47 PM7/31/15
to AdWords API Forum, beama...@gmail.com
I have finally arrived at a workable set of jars.  Problem solved.  Hopefully this list will help others who are attempting to work with v201502.

activation-1.1.jar 
ads-lib-1.38.0.jar 
ads-lib-axis-1.38.0.jar 
adwords-axis-1.38.0.jar 
aopalliance-1.0.jar 
asm-1.0.2.jar 
asm-3.3.1.jar 
axis-1.4.jar
commons-beanutils-1.9.2.jar 
commons-codec-1.3.jar 
commons-collections-3.2.1.jar 
commons-configuration-1.8.jar 
commons-dbcp-1.2.2.jar 
commons-digester-1.6.jar 
commons-discovery-0.4.jar 
commons-httpclient-3.1.jar 
commons-lang-2.3.jar 
commons-logging-1.1.1.jar 
commons-net-2.0-ftp.jar 
commons-pool-1.3.jar
commons-validator-1.3.1.jar  
google-api-client-1.20.0.jar 
google-http-client-1.20.0.jar 
google-http-client-jackson2-1.20.0.jar 
google-oauth-client-1.20.0.jar 
guava-jdk5-13.0.jar 
guice-3.0.jar 
guice-assistedinject-3.0.jar 
guice-multibindings-3.0.jar 
httpclient-4.0.1.jar 
httpcore-4.0.1.jar 
jackson-core-2.1.3.jar 
javax.inject-1.jar 
jaxrpc-api-1.1.jar
json-smart-2.1.0.jar 
jsp-1.2.0.0_2-1.jar 
jsr305-1.3.9.jar  
log4j-1.2.17.jar 
opencsv-1.8.jar 
servlet-1.0.0.0_2-5.jar 
servlet-api-3.0-alpha-1.jar
slf4j-api-1.7.7.jar 
slf4j-log4j12-1.7.5.jar 
springframework-2.5.6.jar 
wsdl4j-1.6.2.jar 
xml-apis-1.0.b2.jar 



On Thursday, July 30, 2015 at 8:30:49 AM UTC-5, The Phantom wrote:

The Phantom

unread,
Jul 31, 2015, 12:40:51 PM7/31/15
to AdWords API Forum, beama...@gmail.com
The trick was to use the following dependencies in a pom.xml file, and then use Maven to generate a web archive file.  The resulting war file contained everything I needed.
<dependency>
            <groupId>com.google.api-ads</groupId>
            <artifactId>adwords-axis</artifactId>
            <version>1.38.0</version>
            <!--<version>1.20.0</version>-->
            <type>jar</type>
            <scope>compile</scope>
</dependency>
<dependency>
             <!--needed for qsm v201502-->
            <groupId>com.google.api-client</groupId>
            <artifactId>google-api-client</artifactId>
            <version>1.20.0</version>
            <type>jar</type>
            <scope>compile</scope>
</dependency>
        <dependency>
         <!--needed, and got for v201502 of qsm-->
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client</artifactId>
            <version>1.20.0</version>
            <type>jar</type>
            <scope>compile</scope>
</dependency> 



On Thursday, July 30, 2015 at 8:30:49 AM UTC-5, The Phantom wrote:

Anthony Madrigal

unread,
Jul 31, 2015, 1:43:15 PM7/31/15
to AdWords API Forum, beama...@gmail.com
Hello,

I am glad to hear that your issue has been resolved! Please let us know if you run into any issues in the future.

Cheers,
Anthony
AdWords API Team
Reply all
Reply to author
Forward
0 new messages