One Star

tJMSInput and tMomInput problem

I have an issue when I'm trying to use tJMSInput and tMomInput components.
my job performs 4 queries whose input parameters are linked.
- the jms receiver get a customer_id
- a query retrieves customer info with input customer_id
- a query retrieves contracts info with customer_id (they can be more than one)
- for each contract, a query retrieves packets info with contract_id (they can be more than one)
- for each packet, a query retrieves services info with packet_id (they can be more than one)
after the 4 queries, it's needed to write an XML with the following structure:
- customer
- contract (repeating)
- packet (repeating)
- service (repeating)
since I can have more than one contracts (or packets), for reach contract tWriteXMLField writes a different xml.
so I need to group all the rows retrieved before writing the XML.
I used tIterateToFlow and now tUnite..
if the Job starts with a fixed customer_id value (i.e. retrieved by a query) it works with both methods.
if the Job starts with a JMS receiver.. the Job seems to die on tWriteXMLField.. without going in error.
this behaviour is very strange, maybe it's a matter of connections between palettes (iterate, row etc) but I can't find a solution because it's my first Talend Job!!!!!!!

Could you help me please? it's very important.
Thanks a lot,