[resolved] Hardcoded temp directory in code

One Star

[resolved] Hardcoded temp directory in code

Hi there,
I just tried running my Talend job on a different computer and that failed due to a hardcoded path in the code.
I can't figure out where that's coming from. It would suggest that a tMap is using some temp file, but all "Store on disk" fields in the tMaps are blank.
Here's the offending code:
org.talend.designer.components.lookup.persistent.PersistentRowSorterIterator<SortableRow_committee_fields> fsi_committee_fields = new org.talend.designer.components.lookup.persistent.PersistentRowSorterIterator<SortableRow_committee_fields>(
"/home/stan/Desktop/workspace/temp" + "/" + jobName
+ "_tMapData_" + pid + "_committee_fields",
2000000) {
public SortableRow_committee_fields createRowInstance() {
return new SortableRow_committee_fields();
}
};

Anyone know where this pesky code is coming from?

Accepted Solutions
One Star

Re: [resolved] Hardcoded temp directory in code

You can.

Indeed. I now realized it will use the temp data path in the Basic Settings of the component (if set).
Thanks for the clarification...

All Replies
Community Manager

Re: [resolved] Hardcoded temp directory in code

Hi
What is the error message? File does not found? Are you able to open the job in studio, if so, go to the code tab and search the related code.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Hardcoded temp directory in code

It was the "Store temp data" setting in the tMap join. I can't remember why I had this switched on - I hope it doesn't break something else.
It seems to me that this feature should let you specify the temp data's location instead of potentially breaking your job when placed on a different machine.
Just for reference, the error on the remote server was:
Exception in component tAdvancedHash_ids_in
java.lang.RuntimeException: The following directory can't be created : '/home/stan/Desktop/workspace/temp'
One Star

Re: [resolved] Hardcoded temp directory in code

You can.
One Star

Re: [resolved] Hardcoded temp directory in code

You can.

Indeed. I now realized it will use the temp data path in the Basic Settings of the component (if set).
Thanks for the clarification...