One Star

[resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

I am playing around with the tGoogleAnalyticsManagement plugin to extract the data from the Google analytics management API.
I have setup the
1) tGoogleAnalyticsManagement
and
2) linked that to 4 tFileOutputExcel modules.
I can connect to the G.A. management API, auth2.0 is all ok but then I get the following error:

Exception in component tGoogleAnalyticsManagement_1
java.lang.NullPointerException
at de.cimt.talendcomp.googleanalytics.GoogleAnalyticsManagement.collectProfiles(GoogleAnalyticsManagement.java:207)
at test2.ga_management_api_0_1.GA_management_API.tGoogleAnalyticsManagement_1Process(GA_management_API.java:1923)
at test2.ga_management_api_0_1.GA_management_API.runJobInTOS(GA_management_API.java:3400)
at test2.ga_management_api_0_1.GA_management_API.main(GA_management_API.java:3258)
Does anyone have any idea what I am doing wrong?
I am quite a newbie with Talend so maybe it something very basics I am doing wrong...
Thanks for the help,
Hans
1 ACCEPTED SOLUTION

Accepted Solutions
Seventeen Stars

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

This component is a bit old and works very well in a couple of my projects (customer projects).
I am very surprised about your problems.
Could you please export your job as Job-Items and send it to me. I will immediately start my investigation whats going on and send you feedback.
Actually the use case for this component is quit simple and the screenshot shows the common usage.
The method collectWebproperties() is not used anymore in the job code. This method is called internal only.
It looks like you have an very very outdated release of this component running.
I also suggest we get rid of the old one:
1. stop your studio
2. delete the component directory (if it not exists, do not worry, I tell you all possible places)

<studio>/plugins/org.talend.designer.components.localprovider_<release>/components/ext/user/tGoogleAnalyticsManagement
and
<studio>/plugins/org.talend.designer.components.localprovider_<release>/components/exchange/user/tGoogleAnalyticsManagement
and
<workspace>/YOUR_PROJECT/components/tGoogleAnalyticsManagement
and
<studio>/plugins/org.talend.designer.components.exchange_<release>/downloaded/tGoogleAnalyticsManagement
and in a user component directory if you have set one in Preferrences->Talend->Components
No let us remove the translators (the code made of the javajet files to create your job code)
<workspace>/.JETEmitters/src/org/talend/designer/codegen/translators/business/google/TGoogleAnalyticsManagementBeginJava.java and TGoogleAnalyticsManagementEndJava.java
and finally
</studio>/configuration/ComponentCache.javacache
OK now start your studio and open you job again. Studio now has to complain the missing component.
Now install the component again (I suggest using the Exchange view).
By the hell, now it must run without further error!!
If not please send me an email and we check it - if you want we can use a WebEx session.
Best regards
Jan Lolling
7 REPLIES
Seventeen Stars

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

Could you please give me an idea about your configuration of this component. It should work and the stack trace line is a bit a miracle for me. At this point a NullPointerException could not happened.
Seventeen Stars

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

I have just updated the component to a newer Google API release (1.15).
Please reinstall this component (now in its release 1.3) from Talend Exchange and try it again.
Unfortunately I could not reproduce your problem, but I have added some code to detect problems in a better way.
One Star

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

Hi Jan, first of all thanks for the quick update and reply. I have updated the component, unfortunately it still doesn't work.
The error code I got now was:
Starting job testmanagementgav2 at 14:41 01/02/2014.
connecting to socket on port 3945
connected
Exception in component tGoogleAnalyticsManagement_1
java.lang.NullPointerException
at de.cimt.talendcomp.googleanalytics.GoogleAnalyticsManagement.collectProfiles(GoogleAnalyticsManagement.java:221)
at test2.testmanagementgav2_0_1.testmanagementgav2.tGoogleAnalyticsManagement_1Process(testmanagementgav2.java:2034)
at test2.testmanagementgav2_0_1.testmanagementgav2.runJobInTOS(testmanagementgav2.java:3121)
at test2.testmanagementgav2_0_1.testmanagementgav2.main(testmanagementgav2.java:2986)
disconnected
Job testmanagementgav2 ended at 14:41 01/02/2014.

What I did do was break it down into different steps, first I did accounts only, that worked fine in an XLS aswell as an CSV output file.
When I added the second step: webproperties, I got an error message during the phase of building the job.
It said:
The method collectWebproperties() is undefined for the type GoogleAnalyticsManagement.
However when I did only: accounts + profiles to CSV I did not get an error mesage during building the job but I got the same error when actually connected to Google analytics.
Hope the information above helps...
Thanks and regards,
Hans
Seventeen Stars

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

This component is a bit old and works very well in a couple of my projects (customer projects).
I am very surprised about your problems.
Could you please export your job as Job-Items and send it to me. I will immediately start my investigation whats going on and send you feedback.
Actually the use case for this component is quit simple and the screenshot shows the common usage.
The method collectWebproperties() is not used anymore in the job code. This method is called internal only.
It looks like you have an very very outdated release of this component running.
I also suggest we get rid of the old one:
1. stop your studio
2. delete the component directory (if it not exists, do not worry, I tell you all possible places)

<studio>/plugins/org.talend.designer.components.localprovider_<release>/components/ext/user/tGoogleAnalyticsManagement
and
<studio>/plugins/org.talend.designer.components.localprovider_<release>/components/exchange/user/tGoogleAnalyticsManagement
and
<workspace>/YOUR_PROJECT/components/tGoogleAnalyticsManagement
and
<studio>/plugins/org.talend.designer.components.exchange_<release>/downloaded/tGoogleAnalyticsManagement
and in a user component directory if you have set one in Preferrences->Talend->Components
No let us remove the translators (the code made of the javajet files to create your job code)
<workspace>/.JETEmitters/src/org/talend/designer/codegen/translators/business/google/TGoogleAnalyticsManagementBeginJava.java and TGoogleAnalyticsManagementEndJava.java
and finally
</studio>/configuration/ComponentCache.javacache
OK now start your studio and open you job again. Studio now has to complain the missing component.
Now install the component again (I suggest using the Exchange view).
By the hell, now it must run without further error!!
If not please send me an email and we check it - if you want we can use a WebEx session.
Best regards
Jan Lolling
Seventeen Stars

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

Please add the flow Profiles to your job.In the current component release is a bug which creates otherwise wrong java code for the job.
I will update the component as soon as possible to fix that.
One Star

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

Hi Jan, thanks for the update, with the latest update all works fine.
Seventeen Stars

Re: [resolved] java.lang.NullPointerException in tGoogleAnalyticsManagement

Yes, because I have accepted the fact of not fully correct configured Google Analytics profiles. Normally it should not happen: a account without a fully filled hierarchy of account->webproperties->profiles but is a fact.
You will see in the console a messages when this inconsistence config occurs.