I compiled the source on my own and am successfully using it right
now. I faced similar issues, quick summary below:

1) Problem is this line :   ((AdWordsService)
obj).setServiceAccountant(new ServiceAccountant((Stub) obj));

this is line 173 of BaseCredentials.java - if you are not aware of
aspectj you might think that this is a bug and there is no such method
as setServiceAccountant on any of the stubs.

setServiceAccountant is defined on each stub using AspectJ ( look in
src/com/google/api/adwords/lib/WebServiceWrapper.aj for more
details) , also look at iajc target @ build.xml

2) I was facing similar issues because i was using loner jar ( i
already have other dependencies in my classpath), the full jar has all
dependencies so even aspectjrt.jar is part of it and if you built the
full jar on your own and use it , you will not face this issue. But
very few people would want to use full jar because of other
dependencies in it and higher chances of breaking xml parsing,
conflicting with jar files of tomcat, resin etc etc ( i tried and
immediately gave up :-) )

3) So other then loner jar i added aspectjrt.jar in my classpath and
everything works good now.

It was hard to figure this out and it is expected to mention these
kinda non-trivial run-time dependencies  in the release notes.


[EMAIL PROTECTED]









On Jul 31, 10:36 am, AdWords API Advisor
<[EMAIL PROTECTED]> wrote:
> Robert,
>
> Can you try using ant build that is shipped with the project
> (build.xml), to compile the sources? The build should automatically
> generate two jars, regular one and loner.
>
> --Stan
>
> On Jul 27, 11:01 am, robertjw <[EMAIL PROTECTED]> wrote:
>
> > Our code does explicitly state the API version when we create the
> > AdWordsUser. We create AdWordsUser like the following:
>
> >                 Map credentials = new HashMap();
> >                 credentials.put("applicationToken", apptkn);
> >                 credentials.put("developerToken", dvltkn );
> >                 credentials.put("useragent", usragt );
> >                 credentials.put("email", email );
> >                 credentials.put("password", passwd );
> >                 credentials.put("version", "v12");
> >                 AdWordsUser myMCC = new AdWordsUser( credentials );
>
> > Furthermore this code DOES work with the compiled version 12 api
> > (adwords-api-1.0.1.jar). We get the classpath error when we try and
> > use the source (compiling it ourselves).
> > Line 172 of the source code of the class:
> > com.google.api.adwords.lib.BaseCredentials is:
>
> >       ((AdWordsService) obj).setServiceAccountant(new
> > ServiceAccountant((Stub) obj));
>
> > Which requires that the obj in question be an instance of
> > AdWordsService
> > obj in our case is an instance of:
> > com.google.api.adwords.v12.AccountServiceSoapBindingStub
> > Which I believe is NOT an instance AdWordsService (in the source
> > code).
>
> > However when we decompiled the AccountServiceSoapBindingStub.class
> > extracted from the binary source (.jar) we found that this class
> > implements com.google.api.adwords.v12.AccountService (i.e. is an
> > instance of AccountService)
>
> > Thanks
>
> > On Jul 25, 6:12 pm, AdWords API Advisor <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hello Robert,
>
> > >  Hmmm, I'm not positive about mis-matches between the compiled .jar
> > > and the provided source (and can ask a colleague about that if need
> > > be), but I've seen that sort of error you describe when there is a
> > > version mismatch between the version of the API (11 or 12) you specify
> > > that you're using in your credentials and the corresponding version of
> > > API whose support libraries you're import-ing into your code. If
> > > you're not specifying an explicit version of the API in your
> > > credentials (either via a "version=1X" line in your ~/
> > > adwords.properties file or via the AdWordsUser() constructor) then
> > > it's going to default to the earliest supported version, 11.
>
> > >  Can you check to make sure your import-ed libraries match the version
> > > in your credentials?
>
> > > Cheers,
> > > -Jeff Posnick, AdWords API Team
>
> > > On Jul 24, 6:46 am, robertjw <[EMAIL PROTECTED]> wrote:
>
> > > > We were trying to use the source code of the class:
> > > > com.google.api.adwords.v12.AccountServiceSoapBindingStub
>
> > > > and noticed that it has this class definition:
>
> > > > public class AccountServiceSoapBindingStub extends
> > > > org.apache.axis.client.Stub implements
> > > > com.google.api.adwords.v12.AccountInterface
>
> > > > Compiling and using this class gives all sort of problems, esp this
> > > > type:
> > > > java.lang.ClassCastException:
> > > > com.google.api.adwords.v12.AccountServiceSoapBindingStub ...
>
> > > > This error does not occur when we use the adwords-api-1.0.1.jar
> > > > provided in the same distribution, so we decompiled the
> > > > AccountServiceSoapBindingStub.class and found that its definition was
> > > > different than the source code. In particular it has this definition:
> > > > public class AccountServiceSoapBindingStub extends Stub  implements
> > > > AccountInterface, AdWordsService
> > > > (note that it implements AdWordsService)
>
> > > > Is there a reason for this difference? If the source and compiled code
> > > > are not the same, it makes debugging code very difficult.
>
> > > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to