googleads / googleads-java-lib

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

Errors in Java maven com.google.api-ads version 2.5.0 #55

Closed larsATadX closed 8 years ago

larsATadX commented 9 years ago

We have 2 Java, Hibernate, Spring v2.5.6 web applications. In v2.4.1 both work fine. But when changing the version to 2.5.0 and AdWords API version 201509, one project boots with Maven 3.3.3 and Jetty version 9.2.11.v20150529. But the other one doesn't. Both uses Java 1.7.0_71

    <dependency>
        <groupId>com.google.api-ads</groupId>
        <artifactId>ads-lib</artifactId>
        <version>2.5.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>com.google.api-ads</groupId>
        <artifactId>adwords-axis</artifactId>
        <version>2.5.0</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.3.1.GA</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-annotations</artifactId>
        <version>3.4.0.GA</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>3.4.0.GA</version>
    </dependency>

The stack dumps are (partially)

[INFO] jetty-9.2.11.v20150529 [INFO] Initializing Spring root WebApplicationContext 2015-10-20 13:54:59,884 ERROR [org.springframework.web.context.ContextLoader] - org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.adxsearch.core.server.service.account.ListManagedAccounts com.adxsearch.core.server.facade.AccountServiceImpl.listManagedAccounts; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'listManagedAccounts': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.adxsearch.core.server.service.publish.PublisherService com.adxsearch.core.server.service.account.ListManagedAccountsImpl.publisherService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'publisherService': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.adxsearch.core.server.service.publish.DeployService com.adxsearch.core.server.service.publish.PublisherServiceImpl.deployService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deployServiceImpl': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.adxsearch.core.server.service.publish.google.adwords.NewGoogleDeploySequencerImpl com.adxsearch.core.server.service.publish.DeployServiceImpl.googleDeploySequencer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'newGoogleDeploySequencer': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.adxsearch.core.server.service.publish.google.bulk.GoogleBulkCampaignDeployer com.adxsearch.core.server.service.publish.google.GoogleDeploySequencerImpl.googleBulkCampaignDeployer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'googleBulkCampaignDeployer': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.adxsearch.core.server.service.publish.google.bulk.GoogleBulkAdDeployer com.adxsearch.core.server.service.publish.google.bulk.GoogleBulkCampaignDeployerImpl.googleBulkAdDeployer; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'googleBulkAdDeployer' defined in file [C:\dev\STS_Workspace_3.6.1\adxcoreScand\target\classes\com\adxsearch\core\server\service\publish\google\bulk\GoogleBulkAdDeployerImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.adxsearch.core.server.service.publish.google.bulk.GoogleBulkAdDeployerImpl]: Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

Caused by: com.google.inject.CreationException: Guice creation errors:

1) Multibinder is not initialized at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:44) while locating java.util.Set<java.util.Map$Entry<com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor$AdWordsSubProduct, com.google.inject.Provider<com.google.api.ads.common.lib.client.HeaderHandler<com.google.api.ads.adwords.lib.client.AdWordsSession, com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor>>>> at com.google.inject.multibindings.MapBinder$RealMapBinder$RealProviderMapProvider.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:44)

2) Multibinder is not initialized at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53) while locating java.util.Set<java.util.Map$Entry<com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor$AdWordsSubProduct, com.google.inject.Provider>> at com.google.inject.multibindings.MapBinder$RealMapBinder$RealProviderMapProvider.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53)

3) Error injecting method, java.lang.NoSuchMethodError: com.google.inject.spi.ProviderInstanceBinding.getUserSuppliedProvider()Ljavax/inject/Provider; at com.google.inject.multibindings.Multibinder$RealMultibinder.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53) Caused by: java.lang.NoSuchMethodError: com.google.inject.spi.ProviderInstanceBinding.getUserSuppliedProvider()Ljavax/inject/Provider;

4) Error injecting method, java.lang.NoSuchMethodError: com.google.inject.spi.ProviderInstanceBinding.getUserSuppliedProvider()Ljavax/inject/Provider; at com.google.inject.multibindings.Multibinder$RealMultibinder.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53) while locating java.util.Set<java.util.Map$Entry<com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor$AdWordsSubProduct, com.google.inject.Provider>> at com.google.inject.multibindings.MapBinder$RealMapBinder$RealProviderMapProvider.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53) Caused by: java.lang.NoSuchMethodError: com.google.inject.spi.ProviderInstanceBinding.getUserSuppliedProvider()Ljavax/inject/Provider;

Neither 201506 nor 201509 works with 2.5.0

Hi,

In v2.5.0, we upgraded to Guice 4.0 (see the ChangeLog). I suspect this is what's causing the exception you mentioned.

Do any of your other maven dependencies depend on Guice? Now that the client library depends on Guice 4.0, you might run into strange problems if another dependency depends on Guice 3.x.

Thanks, Josh, AdWords API Team

I don't think there are any Guice 3.0 dependencies in the project updated to use the 2.5.0 version of the API. If I change the name of the guice 3.0 folders in my local .m2 folder from "3.0" to "3.0.old", the project using the 2.2.0 version of the API doesn't start. It complains about a bunch of Guice 3.0 dependencies which it can't find. But the new project using the 2.5.0 version of the API starts without any complaints. This line of code seems to be the problem: AdWordsServices adWordsServices = new AdWordsServices(); As soon as it's called, a million exceptions are thrown. It doesn't seem to matter in which class I have it. As soon as it's called the execution stops.

Hi,

Are you saying that after you changed your local .m2 folder from 3.0 to 3.0.old, version 2.5.0 worked fine?

The reason that the creation of a new AdWordsServices object leads to this exception is that AdWordsServices has a static final Injector that's created when the AdWordsServices class initializes. Therefore, if there are any Guice-related issues, they'll generally surface at that point.

Thanks, Josh, AdWords API Team

Yes, the 2.2.0 version needs Guice 3.0. The 2.5.0 version does not need Guice 3.0, but it does need Guice 4.0. That folder name needs to be 4.0, not 4.0.old.

Hi,

OK, thanks for confirming. If I'm reading your response correctly, this issue is now resolved (since the 2.5.0 pom.xml requires Guice 4.0). If you're still experiencing issues, please provide more details such as your complete set of Maven dependencies and I'll investigate further.

Thanks, Josh, AdWords API Team

No it's still not working. Here's our pom.xml: As soon as I call adWordsServices = new AdWordsServices(); the exceptions are thrown.

Hi,

Since this is specific to the Java client library, could you open an issue on our issues list so we can better track this? Also, if you could provide the complete set of dependencies using dependency:list, that should help us identify the source of this problem.

Thanks, Josh, AdWords API Team

[DT-LARSG:dev/STS_Workspace3.6.1/adxcoreScand] Lars.Gustafsson> mvn -o dependency:list | grep ":.:.:." | cut -d] -f2- | sed 's/:[a-z]_$//g' | sort -u ant:ant:jar:1.6.5 antlr:antlr:jar:2.7.6 aopalliance:aopalliance:jar:1.0 asm:asm:jar:1.5.3 backport-util-concurrent:backport-util-concurrent:jar:3.1 c3p0:c3p0:jar:0.9.1.2 cglib:cglib:jar:2.1_3 cglib:cglib-nodep:jar:2.1_3 classworlds:classworlds:jar:1.1-alpha-2 com.baidu:api-gateway:jar:1.0.4 com.caucho:hessian:jar:3.1.5 com.fasterxml.jackson.core:jackson-annotations:jar:2.1.2 com.fasterxml.jackson.core:jackson-core:jar:2.1.3 com.fasterxml.jackson.core:jackson-databind:jar:2.1.3 com.google.api-ads:ads-lib:jar:2.5.0 com.google.api-ads:ads-lib-axis:jar:2.5.0 com.google.api-ads:adwords-axis:jar:2.5.0 com.google.api-client:google-api-client:jar:1.20.0 com.google.code.findbugs:jsr305:jar:1.3.9 com.google.guava:guava:jar:19.0-rc2 com.google.guava:guava-jdk5:jar:13.0 com.google.http-client:google-http-client:jar:1.20.0 com.google.http-client:google-http-client-jackson2:jar:1.20.0 com.google.inject.extensions:guice-assistedinject:jar:4.0 com.google.inject.extensions:guice-multibindings:jar:4.0 com.google.inject:guice:jar:4.0 com.google.oauth-client:google-oauth-client:jar:1.20.0 com.microsoft.AdCenter-API:adintelligence:jar:9 com.microsoft.AdCenter-API:bulk:jar:9 com.microsoft.AdCenter-API:campaignmanagement:jar:9 com.microsoft.AdCenter-API:customerbilling:jar:9 com.microsoft.AdCenter-API:customermanagement:jar:9 com.microsoft.AdCenter-API:optimizer:jar:9 com.microsoft.AdCenter-API:reporting:jar:9 com.sun.org.apache.xml.internal:resolver:jar:20050927 com.sun.xml.bind:jaxb-impl:jar:2.1.9 com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.1 com.sun.xml.stream.buffer:streambuffer:jar:0.7 com.sun.xml.stream:sjsxp:jar:1.0.1 com.sun.xml.ws:jaxws-rt:jar:2.1.4 com.thoughtworks.xstream:xstream:jar:1.3.1 commons-beanutils:commons-beanutils:jar:1.8.0 commons-codec:commons-codec:jar:1.3 commons-collections:commons-collections:jar:3.2 commons-configuration:commons-configuration:jar:1.7 commons-dbcp:commons-dbcp:jar:1.2.2 commons-digester:commons-digester:jar:1.8.1 commons-discovery:commons-discovery:jar:0.2 commons-httpclient:commons-httpclient:jar:3.1 commons-io:commons-io:jar:2.4 commons-lang:commons-lang:jar:2.4 commons-logging:commons-logging:jar:1.0.4 commons-logging:commons-logging-api:jar:1.1 commons-net:commons-net:jar:3.2 commons-pool:commons-pool:jar:1.3 dom4j:dom4j:jar:1.6.1 hsqldb:hsqldb:jar:1.8.0.7 javassist:javassist:jar:3.4.GA javax.activation:activation:jar:1.1 javax.annotation:javax.annotation-api:jar:1.2 javax.annotation:jsr250-api:jar:1.0 javax.inject:javax.inject:jar:1 javax.jms:jms:jar:1.1 javax.mail:mail:jar:1.4 javax.persistence:persistence-api:jar:1.0 javax.servlet.jsp:javax.servlet.jsp-api:jar:2.3.1 javax.servlet:javax.servlet-api:jar:3.1.0 javax.servlet:servlet-api:jar:2.5 javax.transaction:jta:jar:1.1 javax.websocket:javax.websocket-api:jar:1.0 javax.xml.bind:jaxb-api:jar:2.1 javax.xml.soap:saaj-api:jar:1.3 javax.xml.stream:stax-api:jar:1.0 javax.xml.ws:jaxws-api:jar:2.1 javax.xml:jaxrpc-api:jar:1.1 jaxrpc:jaxrpc:jar:adwords-7.1.0-dep jdom:jdom:jar:1.0 joda-time:joda-time:jar:2.8.2 joda-time:joda-time-hibernate:jar:1.2 junit:junit:jar:3.8.1 junit-addons:junit-addons:jar:1.4 log4j:log4j:jar:1.2.14 mysql:mysql-connector-java:jar:5.1.5 net.sf.ehcache:ehcache:jar:1.4.1 net.sf.ezmorph:ezmorph:jar:1.0.6 net.sf.json-lib:json-lib:jar:jdk15:2.3 net.sf.jsr107cache:jsr107cache:jar:1.0 net.sf.opencsv:opencsv:jar:2.0 opensymphony:quartz:jar:1.6.3 org.apache.activemq.protobuf:activemq-protobuf:jar:1.0 org.apache.activemq:activeio-core:jar:3.1.2 org.apache.activemq:activemq-core:jar:5.3.0 org.apache.activemq:kahadb:jar:5.3.0 org.apache.axis:axis:jar:1.4 org.apache.axis:axis-saaj:jar:1.4 org.apache.axis2:axis2:jar:1.4 org.apache.commons:commons-csv:jar:1.1 org.apache.cxf:cxf:jar:2.2.9 org.apache.derby:derby:jar:10.4.2.0 org.apache.geronimo.specs:geronimo-j2ee-management_1.0_spec:jar:1.0 org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1 org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1 org.apache.httpcomponents:httpclient:jar:4.3.1 org.apache.httpcomponents:httpcore:jar:4.3.1 org.apache.httpcomponents:httpmime:jar:4.3.1 org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:3.1 org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-6 org.apache.maven:maven-aether-provider:jar:3.0.3 org.apache.maven:maven-artifact:jar:3.0.3 org.apache.maven:maven-artifact-manager:jar:2.2.1 org.apache.maven:maven-core:jar:3.0.3 org.apache.maven:maven-model:jar:3.0.3 org.apache.maven:maven-model-builder:jar:3.0.3 org.apache.maven:maven-plugin-api:jar:3.0.3 org.apache.maven:maven-plugin-descriptor:jar:2.2.1 org.apache.maven:maven-plugin-registry:jar:2.2.1 org.apache.maven:maven-profile:jar:2.2.1 org.apache.maven:maven-project:jar:2.2.1 org.apache.maven:maven-repository-metadata:jar:3.0.3 org.apache.maven:maven-settings:jar:3.0.3 org.apache.maven:maven-settings-builder:jar:3.0.3 org.apache.wicket:wicket:jar:1.4.5 org.apache.wicket:wicket-datetime:jar:1.4.5 org.apache.wicket:wicket-extensions:jar:1.4.5 org.apache.wicket:wicket-ioc:jar:1.4.5 org.apache.wicket:wicket-spring:jar:1.4.5 org.apache.ws.commons.schema:XmlSchema:jar:1.4.5 org.apache.ws.commons.util:ws-commons-util:jar:1.0.2 org.apache.xbean:xbean-spring:jar:3.5 org.apache.xmlrpc:xmlrpc-client:jar:3.1.3 org.apache.xmlrpc:xmlrpc-common:jar:3.1.3 org.apache:neethi:jar:2.0.4 org.aspectj:aspectjrt:jar:1.6.1 org.aspectj:aspectjweaver:jar:1.6.1 org.codehaus.plexus:plexus-classworlds:jar:2.4 org.codehaus.plexus:plexus-component-annotations:jar:1.5.5 org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1 org.codehaus.plexus:plexus-interpolation:jar:1.14 org.codehaus.plexus:plexus-utils:jar:2.0.6 org.dbunit:dbunit:jar:2.2 org.easymock:easymock:jar:2.0 org.eclipse.jdt:core:jar:3.1.1 org.eclipse.jetty.orbit:javax.activation:jar:1.1.0.v201105071233 org.eclipse.jetty.orbit:javax.servlet.jsp.jstl:jar:1.2.0.v201105211821 org.eclipse.jetty.orbit:org.eclipse.jdt.core:jar:3.8.2.v20130121 org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0 org.eclipse.jetty.websocket:javax-websocket-client-impl:jar:9.2.11.v20150529 org.eclipse.jetty.websocket:javax-websocket-server-impl:jar:9.2.11.v20150529 org.eclipse.jetty.websocket:websocket-api:jar:9.2.11.v20150529 org.eclipse.jetty.websocket:websocket-client:jar:9.2.11.v20150529 org.eclipse.jetty.websocket:websocket-common:jar:9.2.11.v20150529 org.eclipse.jetty.websocket:websocket-server:jar:9.2.11.v20150529 org.eclipse.jetty.websocket:websocket-servlet:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-annotations:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-http:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-io:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-jaas:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-jmx:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-jndi:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-jsp:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-plus:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-security:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-server:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-servlet:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-util:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-webapp:jar:9.2.11.v20150529 org.eclipse.jetty:jetty-xml:jar:9.2.11.v20150529 org.glassfish.web:javax.servlet.jsp.jstl:jar:1.2.2 org.glassfish.web:javax.servlet.jsp:jar:2.3.2 org.glassfish:javax.el:jar:3.0.0 org.hamcrest:hamcrest-core:jar:1.1 org.hamcrest:hamcrest-library:jar:1.1 org.hibernate:ejb3-persistence:jar:1.0.2.GA org.hibernate:hibernate-annotations:jar:3.4.0.GA org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA org.hibernate:hibernate-core:jar:3.3.1.GA org.hibernate:hibernate-ehcache:jar:3.3.1.GA org.hibernate:hibernate-entitymanager:jar:3.4.0.GA org.jmock:jmock:jar:2.4.0 org.json:json:jar:20090211 org.jsoup:jsoup:jar:1.7.2 org.jvnet.staxex:stax-ex:jar:1.2 org.jvnet:mimepull:jar:1.2 org.lpsolve:org.lpsolve:jar:5.5 org.mortbay.jetty:jsp-2.1-glassfish:jar:9.1.1.B60.25.p2 org.mortbay.jetty:jsp-2.1-jetty:jar:6.1.21 org.mortbay.jetty:jsp-api-2.1-glassfish:jar:9.1.1.B60.25.p2 org.objectweb:asm:jar:2.2.3 org.osgi:org.osgi.core:jar:4.0 org.ow2.asm:asm:jar:5.0.1 org.ow2.asm:asm-commons:jar:5.0.1 org.ow2.asm:asm-tree:jar:5.0.1 org.restlet.jee:org.restlet.ext.json:jar:2.0-M5 org.restlet.jee:org.restlet.ext.xml:jar:2.0-M5 org.restlet.jee:org.restlet.lib.org.json:jar:2.0 org.restlet.jee:org.restlet:jar:2.0-M5 org.restlet:org.restlet.ext.servlet:jar:2.0-SNAPSHOT-M5 org.restlet:org.restlet.ext.spring:jar:2.0-SNAPSHOT-M5 org.restlet:org.restlet:jar:2.0-SNAPSHOT-M5 org.slf4j:slf4j-api:jar:1.5.2 org.slf4j:slf4j-log4j12:jar:1.5.2 org.sonatype.aether:aether-api:jar:1.11 org.sonatype.aether:aether-impl:jar:1.11 org.sonatype.aether:aether-spi:jar:1.11 org.sonatype.aether:aether-util:jar:1.11 org.sonatype.plexus:plexus-cipher:jar:1.4 org.sonatype.plexus:plexus-sec-dispatcher:jar:1.3 org.sonatype.sisu:sisu-guice:jar:no_aop:2.9.4 org.sonatype.sisu:sisu-inject-bean:jar:2.1.1 org.sonatype.sisu:sisu-inject-plexus:jar:2.1.1 org.springframework:spring:jar:2.5.6 org.springframework:spring-aop:jar:2.5.6 org.springframework:spring-beans:jar:2.5.6 org.springframework:spring-context:jar:2.5.6 org.springframework:spring-context-support:jar:2.5.6 org.springframework:spring-core:jar:2.5.6 org.springframework:spring-jms:jar:2.5.6 org.springframework:spring-tx:jar:2.5.6 org.springframework:spring-web:jar:2.5.6 org.springframework:spring-webmvc:jar:2.5.6 org.springframework:spring-webmvc-portlet:jar:2.5.6 org.testng:testng:jar:jdk15:5.7 org.wicketstuff:inmethod-grid:jar:1.4.9.2 poi:poi:jar:2.5.1-final-20040804 saaj:saaj:jar:adwords-7.1.0-dep wsdl4j:wsdl4j:jar:1.6.2 xalan:serializer:jar:2.7.1 xalan:xalan:jar:2.7.1 xerces:xercesImpl:jar:2.9.1 xerces:xmlParserAPIs:jar:2.6.2 xml:xml-apis:jar:1.3.04 xml-apis:xml-apis:jar:1.3.04 xpp3:xpp3_min:jar:1.1.4c 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: commons-lang:commons-lang:jar -> duplicate declaration of version 2.4 @ line 408, column 21 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: net.sf.json-lib:json-lib:jar:jdk15 -> duplicate declaration of version 2.3 @ line 212, column 21 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.restlet:org.restlet:jar -> duplicate declaration of version 2.0-SNAPSHOT-M5 @ line 182, column 21 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: wsdl4j:wsdl4j:jar -> version 1.5.1 vs 1.6.2 @ line 359, column 21 Finished at: 2015-10-28T12:46:55+01:00 Some problems were encountered while building the effective model for com.adxsearch:adxcore-adxapp:war:5.12.0.0 The POM for org.apache:neethi:jar:2.0.4 is missing, no dependency information available The POM for org.glassfish:javax.el:jar:3.0.1-b06-SNAPSHOT is missing, no dependency information available The POM for org.glassfish:javax.el:jar:3.0.1-b07-SNAPSHOT is missing, no dependency information available The POM for org.glassfish:javax.el:jar:3.0.1-b08-SNAPSHOT is missing, no dependency information available The POM for org.objectweb:asm:jar:2.2.3 is missing, no dependency information available The POM for org.restlet:org.restlet.ext.servlet:jar:2.0-SNAPSHOT-M5 is missing, no dependency information available The POM for org.restlet:org.restlet.ext.spring:jar:2.0-SNAPSHOT-M5 is missing, no dependency information available The POM for org.restlet:org.restlet:jar:2.0-SNAPSHOT-M5 is missing, no dependency information available

larsATadX commented 9 years ago

ant : ant : jar : 1.6.5

larsATadX commented 9 years ago

Adding

    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>4.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-assistedinject</artifactId>
      <version>4.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-multibindings</artifactId>
      <version>4.0</version>
    </dependency>

to the pom.xml solved the problem. Thanks to https://github.com/googleads/googleads-java-lib/issues/51

jradcliff commented 9 years ago

Thanks for the update. Are you saying you had to add those dependencies to your pom.xml? I ask because the ads_lib pom already contains that exact set of dependencies.

https://github.com/googleads/googleads-java-lib/blob/master/modules/ads_lib/pom.xml#L161

Thanks

larsATadX commented 9 years ago

As soon as I remove the lines described above from my pom.xml, I get:

2015-10-28 14:58:25,482 WARN [org.springframework.jms.listener.DefaultMessageListenerContainer] - java.lang.ExceptionInInitializerError at com.adxsearch.core.server.service.sync.google.GoogleCampaignSynchronizerImpl.getEntries(GoogleCampaignSynchronizerImpl.java:137) at com.adxsearch.core.server.service.sync.google.GoogleCampaignSynchronizerImpl.syncGoogleCampaign(GoogleCampaignSynchronizerImpl.java:109) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy146.syncGoogleCampaign(Unknown Source) at com.adxsearch.core.server.service.sync.SyncServiceImpl.syncCampaign(SyncServiceImpl.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy147.syncCampaign(Unknown Source) at com.adxsearch.core.server.service.messaging.AutoSynchMessageReceiver.onMessage(AutoSynchMessageReceiver.java:54) at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543) at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876) at java.lang.Thread.run(Thread.java:745) Caused by: com.google.inject.CreationException: Guice creation errors:

1) Multibinder is not initialized at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:44) while locating java.util.Set<java.util.Map$Entry<com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor$AdWordsSubProduct, com.google.inject.Provider<com.google.api.ads.common.lib.client.HeaderHandler<com.google.api.ads.adwords.lib.client.AdWordsSession, com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor>>>> at com.google.inject.multibindings.MapBinder$RealMapBinder$RealProviderMapProvider.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:44)

2) Multibinder is not initialized at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53) while locating java.util.Set<java.util.Map$Entry<com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor$AdWordsSubProduct, com.google.inject.Provider>> at com.google.inject.multibindings.MapBinder$RealMapBinder$RealProviderMapProvider.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:53)

3) Error injecting method, java.lang.NoSuchMethodError: com.google.inject.spi.ProviderInstanceBinding.getUserSuppliedProvider()Ljavax/inject/Provider; at com.google.inject.multibindings.Multibinder$RealMultibinder.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:44) while locating java.util.Set<java.util.Map$Entry<com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor$AdWordsSubProduct, com.google.inject.Provider<com.google.api.ads.common.lib.client.HeaderHandler<com.google.api.ads.adwords.lib.client.AdWordsSession, com.google.api.ads.adwords.lib.client.AdWordsServiceDescriptor>>>> at com.google.inject.multibindings.MapBinder$RealMapBinder$RealProviderMapProvider.initialize(Unknown Source) at com.google.api.ads.adwords.axis.AdWordsAxisModule.configure(AdWordsAxisModule.java:44) Caused by: java.lang.NoSuchMethodError: com.google.inject.spi.ProviderInstanceBinding.getUserSuppliedProvider()Ljavax/inject/Provider; at com.google.inject.multibindings.Indexer.visit(Indexer.java:139) at com.google.inject.multibindings.Indexer.visit(Indexer.java:43) at com.google.inject.internal.ProviderInstanceBindingImpl.acceptTargetVisitor(ProviderInstanceBindingImpl.java:62) at com.google.inject.multibindings.Multibinder$RealMultibinder.initialize(Multibinder.java:332)

Thanks for your help.

larsATadX commented 9 years ago

I have

<dependency>
  <groupId>com.google.inject</groupId>
  <artifactId>guice</artifactId>
  <version>4.0</version>
</dependency>
<dependency>
  <groupId>com.google.inject.extensions</groupId>
  <artifactId>guice-assistedinject</artifactId>
  <version>4.0</version>
</dependency>
<dependency>
  <groupId>com.google.inject.extensions</groupId>
  <artifactId>guice-multibindings</artifactId>
  <version>4.0</version>
</dependency>

also in my C:\Users\myname.m2\repository\com\google\api-ads\ads-lib\2.5.0

jradcliff commented 9 years ago

Weird...I would expect maven to pick up those dependencies from the ads-lib 2.5.0 pom. It's possible (although unlikely, I hope) that one of your other dependencies is explicitly excluding those Guice dependencies.

Regardless, thanks for posting your solution for this. I'll reopen this issue if others encounter this problem, as that would indicate a larger issue that's not unique to your setup.

larsATadX commented 8 years ago

Adding the dependency declarations worked on Windows (my development machine) and Linux 14.04 LTS but under SmartOS version 14.4.2 the Java war webapplication sometimes boots and sometimes doesn't boot. The exceptions thrown at boot are the same as the ones listed above "Multibinder is not initialized". Jetty v9 is not available as a package for SmartOS. The only avilable version of Jetty is v7. I changed the version of google-api-ads to 2.7.0 ads-lib and adwords-axis. Didn't work.

jradcliff commented 8 years ago

Have you tried explicitly instantiating the Injector by calling new AdWordsServices() before you instantiate your ServletContextHandler, as described in this article?

http://blog.timmattison.com/archives/2014/09/02/full-example-code-showing-how-to-use-guice-and-jetty/

larsATadX commented 8 years ago

That example describes a small system without a web.xml. I have a full system with a web.xml and an applicationContext.xml.

jradcliff commented 8 years ago

Given that this works with Jetty v9 but not Jetty v7.1, I think this is a Jetty problem. Have you tried contacting the SmartOS support team to see why they are only supporting v7.1? According to this page, Jetty v7 and v8 are EOL:

http://wiki.eclipse.org/Jetty#Jetty_Documentation

jradcliff commented 8 years ago

Hi,

I haven't heard back from you in a while. Were you able to get any indication from SmartOS as to when they will upgrade to a supported version of Jetty?

Thanks, Josh, AdWords API Team

larsATadX commented 8 years ago

The SmartOS team (lead by Jonathan Perkins) said the would create a pkgsrc package for Jetty 9.2 in the 201504 release. I'm still waiting for them. Meanwhile I have to try several times before the Jetty server starts. (when restarting it)

jradcliff commented 8 years ago

Since this is an issue with SmartOS, I'm going to close it, but please reopen if you have further questions.

Thanks, Josh, AdWords API Team