I fixed the problem this afternoon. The only change between code that worked
and code that didn't was that I had added an external jar (JFreeChart) to my
build path. Since I don't really need that library, I deleted it and things
started working again.
The stack trace to the error was like:
Exception in thread "main" java.lang.NullPointerException; at
com.google.api.adwords.v13.ReportServiceSoapBindingStub.scheduleReportJob(ReportServiceSoapBindingStub.java:612)
And then my classes. It was sparse - sorry I don't have it now that the
problem is fixed.
/////////////////////////////////////////
The code that generated the error was:
AdWordsServiceLogger.log();
AdWordsUser user = new AdWordsUser();
ReportInterface reportService =
user.getService(AdWordsService.V13.REPORT_SERVICE);
DefinedReportJob job = new DefinedReportJob();
job.setAggregationTypes(new String[] {"Daily"});
job.setSelectedReportType("Keyword");
job.setStartDay(new ReportDate(2009, 7, 15).toDate());
job.setEndDay(new ReportDate(2009, 7, 15).toDate());
job.setName("Test");
//job.setIncludeZeroImpression(true);
job.setSelectedColumns(new String[] {
"AdGroup", "Keyword","QualityScore","Impressions"
});
// Validate report job.
reportService.validateReportJob(job);
// Schedule report job.
reportService.scheduleReportJob(job); //<---- null pointer exception
thrown here
////////////////////////////////////////
I'm using the most recent java library.
Thanks for the response..let me know if you need anything else on my end (glad
to find out the origin of this problem...the addition of a jar to the build
path is a weird reason to get an error, I think).
Brian
-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of AdWords API Advisor
Sent: Friday, July 17, 2009 4:18 PM
To: AdWords API Forum
Subject: AdWords API Re: reportservice.schedulereportjob nullpointer
Hello Brian,
Could you provide the full stacktrace associated with the exception?
Cheers,
-Jeff Posnick, AdWords API Team
On Jul 17, 10:32 am, briancaw <[email protected]> wrote:
> I've been running the same code every day for weeks now and today I've
> gotten a nullpointer error in reportservice.schedulereportjob method.
>
> I am using the java code library v4.1.0 (not sample)
>
> What's even weirder is that I exported the code as a jar a few days
> ago and that code still runs. And its exactly the same code.
>
> Please let m knoe if you guys know what this is about.
>
> Thanks,
>
> Brian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---