My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 6: ApiException isn't throwable in dfp-api-2.9.0-loner.tar.gz
2 people starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ----
Closed:  Dec 2011


 
Reported by andrewma...@gmail.com, Dec 8, 2011
What steps will reproduce the problem?
1. Use the loner API jar
2. Define a Report Job
3. Define a Report Query
4. Attach the Report Query to the Report Job
5. Submit the Report Job to the ReportService
6. The Report Service throws two exceptions, a APIException and a RemoteException.

What is the expected output? What do you see instead?
APiException should be throwable.

What version of the product are you using? On what operating system?
v.201111


apiexception.tiff
42.4 KB   Download
Dec 8, 2011
Project Member #1 api.arogal@gmail.com
Hi,

Not sure I fully understand the problem. The service will through an ApiException, which extends AxisFault, and RemoteExcpetion from there, which is a Throwable:

http://ws.apache.org/axis/java/apiDocs/org/apache/axis/AxisFault.html

Can you clarify please?

Dec 8, 2011
#2 andrewma...@gmail.com
When I use the dfp-api-2.9.0-loner.jar the ApiException does is not a compatible type. 

The error message I receive is: 
Incompatible types. Found 'com.google.api.ads.dfp.v201111.ApiException' required: 'java.lang.Throwable'.
Dec 8, 2011
Project Member #3 api.arogal@gmail.com
Doing something like:

    } catch (Exception e) {
      e.printStackTrace();
    } catch (ApiException e) {
      e.printStackTrace();
    }

Won't work since ApiException is an Exception. Instead, you may wan to do:

    } catch (ApiException e) {
      e.printStackTrace();
    } catch (Exception e) {
      e.printStackTrace();
      // Do something else or maybe don't even catch this.
    }
    
Status: WontFix
Dec 8, 2011
#4 andrewma...@gmail.com
Being explicit with the exceptions like this:

        try {
            report_job = rsi.runReportJob(report_job);
        }
        catch ( ApiException e )
        {
            e.printStackTrace();
        }
        catch (RemoteException e)
        {
            e.printStackTrace();
        }

Will illustrate the error with the loner package.
Dec 8, 2011
Project Member #5 api.arogal@gmail.com
Doing 

    try { 

    } catch (ApiException e) {
      e.printStackTrace();
    } catch (RemoteException e) {
      e.printStackTrace();
    }

Works fine for me. Can you attach your complete java without any credentials? Are you perhaps not importing the classes correctly?
Dec 8, 2011
#6 andrewma...@gmail.com
I'm running the example in IntelliJ 10.5.2, the source here: 

http://www.google.com/codesearch/p?hl=en#7SXNM5his40/trunk/examples/v201111/reportservice/RunDeliveryReportExample.java

I've imported the "regular" version and it works. This problem exists only for when I use the "loner" lib.
Dec 8, 2011
Project Member #7 api.arogal@gmail.com
Can you paste your import lines as well? Since ApiException isn't imported there, it will be different.

What version of Axis are you using? The one in the lib_jars tarball?
Dec 9, 2011
Project Member #8 api.arogal@gmail.com
Hi, 

I can't seem to recreate this.

Can you make sure you import:

import com.google.api.ads.dfp.v201111.ApiException;

That might fix the issue.
Dec 11, 2011
#9 n...@insidiae.net
Got it. Confusion on my part on how to use the libs.

Powered by Google Project Hosting