tJava Error

One Star

tJava Error

I'm receiving the following error when assigning values to globalMap variables.
Error Message
"Exception in component tJava_7
java.lang.NullPointerException
at talenddemosjava.lawexpediaftp_0_1.LAWExpediaFTP.tMSSqlInput_2Process(LAWExpediaFTP.java:965)"
Below is the tJava code:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
List<row8Struct> Law = (List<row8Struct>)globalMap.get("Law_Metadata");
globalMap.put("ExpediaFileShare", Law.get(0).TheValue);
globalMap.put("ExpediaFileShareArchive", Law.get(1).TheValue);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
One Star

Re: tJava Error

Very weird, as I expect value returned.
I did another test from tMSSqlInput to tJava.
simple query "select TheValue from vFileShare" with row7 connecting to tJava.
In tJava, I just type the following, but context.FileShare=null (no error).
context.FileShare=row7.TheValue;
Any idea?
Help is appreciated!
Highlighted
One Star

Re: tJava Error

u need to use tJavaRow
One Star

Re: tJava Error

I don't think you can put List<row3Struct> construct in JavaRow. Let me know if I am wrong.
I keep getting "NullPointerException" errors. Any reason??? Very fraustration error...

Re: tJava Error

in a tJavaRow you can use "special" variable names that will get re-written by the code generator.
instead of writing row7.TheValue, try: input_row.TheValue
also ensure that your Talend schema has the column "TheValue" defined

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now