Hello Liu, I'm fairly sure that this has to be *something* related to your environment, as the same code is used by many developers out there without issue. That being said, there are a lot of interesting ways the Java runtime can get muddled up, and I can't say exactly what it is that is leading to your problems. Perhaps one of the many folks using the Java client library in this Google Group has seen similar behavior before.
The AdWords API is implemented as a SOAP service and you can of course just generate your own Java classes using a SOAP toolkit like Axis (which what we do with the Java client library). If you can't get the library we provide working in your environment, and you definitely want to program in Java, perhaps you can go that route. Cheers, -Jeff Posnick, AdWords API Team On Oct 11, 1:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello Jeff, > thanks for your reply. > I'm sure the environment is correct. > I do what you mean,but the exception is as usual. > > liu > > On 10月11日, 上午3时20分, AdWords API Advisor <[EMAIL PROTECTED]> > wrote: > > > Hello Liu, > > > The example code provided along with the Java Client Library does > > work. It's just very important that (as with any Java project) you > > have your environment set up properly and have all the necessary > > libraries on the classpath. > > > Can you confirm that you've > > > a) downloaded a fresh copy of the Java Client Library from > > > http://google-api-adwords-java.googlecode.com/files/awapi_java_lib_2.... > > > b) followed all the steps in the first and last paragraphs of the "How > > do I start?" section of the README > > > http://code.google.com/p/google-api-adwords-java/source/browse/trunk/... > > > When following the steps, use the "lib/adwords-api-{version}.jar" > > version of the .jar file in your classpath for simplicities sake. > > > Cheers, > > -Jeff Posnick, AdWords API Team > > > On Oct 10, 3:26 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > > Hello Das,thanks for your reply. > > > But the exception is ClassCaseException,it does nothing to do with me, > > > and the example is provide by adwords api. > > > > On 10月10日, 上午5时40分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > > wrote: > > > > > Hi, > > > > > 1. Copy all the include-lib.zip to includelib and lib.zip to lib under > > > > awapi_java_lib_2.1.0. > > > > (I believe include-lib.zip & lib.zip comes when download Java-adword- > > > > api). > > > > 2. Change the adword.properties. (Mean get the right credentials). you > > > > need to place this file under home. > > > > (for e.g my home is C:\Documents and Settings\das > > > > 3 .Run build.xml. > > > > 4. Then you should be able to run all the demo classes. > > > > > Thanks, > > > > Das > > > > > On Oct 9, 2:14 pm, "Jan Piotrowski (AdWords API Guru)" > > > > > <[EMAIL PROTECTED]> wrote: > > > > > Okay. I changed the subject of the thread, perhaps then some of the > > > > > Java people will see it and reply. > > > > > > - Jan > > > > > > On 9 Okt., 17:31, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > Jan,thanks for your reply. > > > > > > You are right, the library is java.But I don't know why the example > > > > > > throw exception,the only reason I think is the problem of the > > > > > > library > > > > > > of java. > > > > > > > On 10月9日, 下午6时01分, "Jan Piotrowski (AdWords API Guru)" > > > > > > > <[EMAIL PROTECTED]> wrote: > > > > > > > So then it is not a problem of the Adwords API but of the library > > > > > > > you > > > > > > > are using. Looks like Java? > > > > > > > > - Jan > > > > > > > > On 9 Okt., 09:39, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > > > In the class KeywordToolDemo provide by google,the JVM throw > > > > > > > > exception > > > > > > > > at the line:KeywordToolInterface service = > > > > > > > > (KeywordToolInterface) > > > > > > > > user.getService(user.KEYWORDTOOL_SERVICE), > > > > > > > > in fact the exception occor in the class BaseCredentials at the > > > > > > > > line > > > > > > > > ((AdWordsService) obj).setServiceAccountant(new > > > > > > > > ServiceAccountant((Stub) obj)); > > > > > > > > because obj is type of KeywordToolServiceSoapBindingStub > > > > > > > > ,exception is > > > > > > > > following: > > > > > > > > > Exception in thread "main" javax.xml.rpc.ServiceException: > > > > > > > > java.lang.ClassCastException: > > > > > > > > com.google.api.adwords.v12.KeywordToolServiceSoapBindingStub > > > > > > > > cannot be > > > > > > > > cast to com.google.api.adwords.lib.AdWordsService > > > > > > > > at > > > > > > > > com.google.api.adwords.lib.BaseCredentials.getService(BaseCredentials.java: > > > > > > > > 177) > > > > > > > > at > > > > > > > > examples.KeywordToolDemo.main(KeywordToolDemo.java:45) > > > > > > > > > I'm sure there is no other exception. > > > > > > > > looking forward your reply,thanks!- Hide quoted text - > > > > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
