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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Labels (3)
4 Replies
Anonymous
Not applicable
Author

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!
Anonymous
Not applicable
Author

u need to use tJavaRow
Anonymous
Not applicable
Author

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...
Anonymous
Not applicable
Author

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