Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Could you share the settings in TRestclient component tab?
Yes of course, the value of the headers match the API requirements (which i'm very used to)
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.
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...
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 🙂
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.