Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Jpoisson
Contributor
Contributor

tRESTClient can't start

Hi,

I'm very new to Talend and I'm trying to build a job supposed to take data from a CSV and send them parsed as a JSON object to a remote API.

The issue comes from the component tRESTClient which always return me a "NullPointerException" error but I cannot understand where it comes from.

The funny part is that is works on someone else computer (who already worked on Talend) but not mine.

Here is the stack trace :

   mars 22, 2021 3:02:45 PM org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean createWebClient

   GRAVE: java.lang.NullPointerException : null

   Exception in component tRESTClient_2 (Migrate_users)

   java.lang.RuntimeException: java.lang.NullPointerException

    at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWebClient(JAXRSClientFactoryBean.java:234)

    at staubli_migration_users.migrate_users_0_1.Migrate_users.tFileInputDelimited_1Process(Migrate_users.java:3745)

    at staubli_migration_users.migrate_users_0_1.Migrate_users.runJobInTOS(Migrate_users.java:4648)

    at staubli_migration_users.migrate_users_0_1.Migrate_users.main(Migrate_users.java:4444)

   Caused by: java.lang.NullPointerException

    at org.apache.cxf.jaxrs.client.WebClient.convertStringToURI(WebClient.java:1280)

    at org.apache.cxf.jaxrs.client.WebClient.<init>(WebClient.java:97)

    at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWebClient(JAXRSClientFactoryBean.java:224)

    ... 3 more

   

Labels (3)
7 Replies
Jpoisson
Contributor
Contributor
Author

0695b00000Dt4vcAAB.png

knknaveen
Contributor II
Contributor II

Could you share the settings in TRestclient component tab?

 

Jpoisson
Contributor
Contributor
Author

Yes of course, the value of the headers match the API requirements (which i'm very used to)

 

0695b00000Dt5biAAB.png0695b00000Dt5bYAAR.png

evansdar
Contributor II
Contributor II

Either your contexts are null or something you're passing into the component is null. What do your contexts look like? What is logged from your tLogRow_2.

Jpoisson
Contributor
Contributor
Author

I found that if I put the data directly in the field it works, as if the context was not used. But inside the execute tab it displays my context with the correct data...

emilieAzm
Contributor
Contributor

Hello,

I've had the exact same problem, context variable wouldn't load, always displayed "null".

I placed a tcontextdump in the job, and a tlogrow at the end of it.

From this moment, my variable was correctly loaded and worked just fine...

I think this is a bug from Talend, you might try this out 🙂

 

Leukipp
Contributor
Contributor

I had the same issue after copying an operator from one job to another. After removing and re-adding the context variables from the context, the REST operator was happy again.