googleads / googleads-java-lib

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

Exception while using Java 11 #180

Closed alphawolf1988 closed 10 months ago

alphawolf1988 commented 5 years ago

I'm getting the following exception, if i use the library with Java 11:

` Caused by: java.lang.NoClassDefFoundError: javax/xml/soap/SOAPHeaderElement at java.base/java.lang.Class.getDeclaredConstructors0(Native Method) at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137) at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2357) at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245) at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:115) at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:706) at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:930) at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:852) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:291) at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:222) at com.google.inject.internal.InjectorImpl.createParameterInjector(InjectorImpl.java:991) at com.google.inject.internal.InjectorImpl.getParametersInjectors(InjectorImpl.java:978) at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:69) at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29) at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37) at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33) at com.google.inject.internal.FailableCache$1.load(FailableCache.java:40) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208) ... 56 more Caused by: java.lang.ClassNotFoundException: javax.xml.soap.SOAPHeaderElement at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 77 more

`

Raibaz commented 5 years ago

Hi,

This really looks like an issue with the Java EE modules that are no longer endorsed in the JDK since Java 9.

Can you please provide more information on how to reproduce this? What are you executing when this exception is thrown?

Thanks, Mattia

nwbirnie commented 5 years ago

It looks like we missed the fact that JDK 9 enables SOAP via modules, but JDK 11 removes SOAP support entirely. Therefore the following dependency needs to be added to restore SOAP classes.

    <dependency>
      <groupId>javax.xml.soap</groupId>
      <artifactId>javax.xml.soap-api</artifactId>
      <version>1.4.0</version>
    </dependency>

I'll send an update out shortly for this, apologies for the inconvenience.

christopherseeley commented 10 months ago

Fixed in v4.7.0