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);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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!
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...
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