tJavaRow Errors

One Star

tJavaRow Errors

I have my components set up as the attached image shows.
Before I added the tJavaRow component it did not have any errors and it ran correctly.
After adding the tJavaRow I got
The method tMysqlInput_1Process(Map<String,Object>) is undefined for the type DBtoXML10
A component that is not a sub process start can not have any link on sub job ok / on sub job error in input.
Currently the only code in the tjava row is this ( I will add additional later)
output_row.ID = input_row.ID;
output_row.title = input_row.title;
output_row.sub_title = input_row.sub_title;
One Star

Re: tJavaRow Errors

Which version of TOS do you use?
I encountered this issue before and it was solved by deleting the current job and recreating a new one.
Seven Stars

Re: tJavaRow Errors

The problem is OnSubjobOK must go to/from the start component of the subjob (the one with a green background). In your job that is tMysqlInput_2 (because that is merge order 1) but OnSubjobOK is linked to tMysqlInput_1, which is why the latter has an error mark against it.
One Star

Re: tJavaRow Errors

I changed the connection to the merge order 1 and it ran thanks for your help.
One Star

Re: tJavaRow Errors

I am having an additional problem
In the tJavaRow I have a context variable context.fileNumber every 5000 records this is incremmented by 1.
In the File Name text field of the tFileOutputMSXML i have enter "C:/opt/ftp/talend/XMLFiles/out"+context.fileNumber+".xml"
I have added printstatements to the tJaveRow that show the variable incrementing correctly but only the one XML file is created.
Is it possible to split the files using this method?
Seven Stars

Re: tJavaRow Errors

No; the output file is created before the flow starts.
I've never used tFileOutputMSXML so I'm not sure how to resolve this because it takes multiple flows.
The usual suggestion for a single flow is to use tFlowToIterate and tFixedFlowInput before the output, although this would likely be way too slow for so many rows.
Other ways, again for a single flow, might be to:
1. store the final row data in a temporary file or hash and then as a subsequent subjob execute a loop for the number of files you need, re-reading the temporary file or hash, filtering based on the fileNumber and writing to each xml file.
2. write the final row data to a delimited file, using the ability to split to multiple files and then as a subsequent subjob iterate over the created files to write them as xml.
If you can't figure out a way to achieve something like that with your data then I suggest you create a new topic for more help from someone else.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey


Talend named a Leader.

Get your copy


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


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.