I'm trying to run the GetAccountHierarchy example. It works perfectly fine when run ass part of a small example project (call it SampleProject) with the following pom.xml:
However, when used in a larger project (call it ProdProject -- here it is hard to isolate a reproducible case) the error in the subject appears, with the following stack trace:
java.lang.NoClassDefFoundError: com/google/api/FieldBehaviorProto
at com.google.ads.googleads.v6.resources.CustomerClientProto.<clinit>(CustomerClientProto.java:62)
at com.google.ads.googleads.v6.resources.CustomerClient.getDescriptor(CustomerClient.java:139)
at com.google.ads.googleads.v6.resources.CustomerClient.hashCode(CustomerClient.java:740)
at java.util.HashMap.hash(HashMap.java:339)
at java.util.HashMap.put(HashMap.java:612)
at mypkg.GetAccountHierarchy.createCustomerClientToHierarchy(GetAccountHierarchy.java:271)
at mypkg.GetAccountHierarchy.gatherHierarchies(GetAccountHierarchy.java:124)
Because there's some formatting differences between the example [here] and as run, clarifying that GetAccountHierarchy.java:271 is
I'm trying to run the GetAccountHierarchy example. It works perfectly fine when run ass part of a small example project (call it SampleProject) with the following pom.xml:
However, when used in a larger project (call it ProdProject -- here it is hard to isolate a reproducible case) the error in the subject appears, with the following stack trace:
Because there's some formatting differences between the example [here] and as run, clarifying that
GetAccountHierarchy.java:271
isand
GetAccountHierarchy.java:124
isThis ProdProject does not directly reference the api-ads libraries, but instead references LibProject which in turn has the following google libraries
As a workaround, adding the following to the pom.xml of the ProdProject works:
However, it would be good to understand what the problem is and why the SampleProject works without this dependency.