1

I am attempting to build an import tool using Talend Open Studio 6.1.1, which will import various tab-delimited .txt files that have been compressed into a ZIP file.

To accomplish this, I'm using the tFileUnarchive component. The Archive File for this component is set to "context.RECORD1", where RECORD1 is the file path to the ZIP.

As such, the Extraction Directory is set to "context.RECORD1.substring(0,context.RECORD1.lastIndexOf("/"))".

This component then is connected to various tFileInputDelimited components using Trigger > Run If. The condition in the Run If, for example, will be:

globalMap.get("tFileExist_1_FILENAME").toString().contains("VAM")

to extract one of the tab-delimited files (within the ZIP) that has "VAM" in its name. However, the job fails with the following error output:

Exception in component tFileUnarchive_2
java.lang.NullPointerException
    at map_2016.map2016_0_1.map2016.tFileUnarchive_2Process(map2016.java:2027)
    at map_2016.map2016_0_1.map2016.tPostgresqlConnection_1Process(map2016.java:1764)
    at map_2016.map2016_0_1.map2016.runJobInTOS(map2016.java:48371)
    at map_2016.map2016_0_1.map2016.main(map2016.java:48186)

One thing to note: I'm not using all of the tab-delimited .txt files that are contained in the original ZIP, as some of them are not relevant to my purposes.

Any help will be greatly appreciated!

YCF_L
  • 49,027
  • 13
  • 75
  • 115
  • Possible duplicate of [What is a NullPointerException, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – Mad Physicist Dec 23 '16 at 20:00

1 Answers1

0

globalMap.get("tFileExist_1_FILENAME").toString().contains("VAM")

globalMap or the result of globalMap.get(...) or return of .toString() is null.

see also: What is a NullPointerException, and how do I fix it?

Community
  • 1
  • 1
pL4Gu33
  • 1,733
  • 12
  • 34