tSalesforceOutputBulkExec Component Fails with Invalid Batch

One Star

tSalesforceOutputBulkExec Component Fails with Invalid Batch

1) I have a SQL Server 2008 R2 database that has a view of task records that I am trying to push into Salesforce. I created a job using the tSalesforceOutputBulkExec Component. It runs through 1400 records and then abends with "Invalid Batch".
Starting job TCPTasks at 21:51 26/03/2012.
connecting to socket on port 3811
connected
Exception in component tSalesforceOutputBulkExec_2_tSBE

at com.sforce.async.BulkConnection.parseAndThrowException(BulkConnection.java:108)
at com.sforce.async.BulkConnection.doHttpGet(BulkConnection.java:472)
at com.sforce.async.BulkConnection.getBatchResultStream(BulkConnection.java:369)
at org.talend.salesforceBulk.SalesforceBulkAPI.getBatchLog(SalesforceBulkAPI.java:327)
at tcp.tcptasks_0_1.TCPTasks.tMSSqlInput_1Process(TCPTasks.java:3294)
at tcp.tcptasks_0_1.TCPTasks.runJobInTOS(TCPTasks.java:5280)
at tcp.tcptasks_0_1.TCPTasks.main(TCPTasks.java:5148)
disconnected
Job TCPTasks ended at 21:51 26/03/2012.
2) Then I created another job using the tSalesforceOutput component and it runs perfectly, migrating all records.
Starting job TCPTasksNONBulk at 21:54 26/03/2012.
connecting to socket on port 3804
connected
disconnected
Job TCPTasksNONBulk ended at 22:00 26/03/2012.
3) Right now, I'm working with a smaller subset of records (2665) so I can debug this problem; however my client has 205K tasks that I must migrate so I really need to use the bulk component.
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

Hi
Please check the schema of both input component and tSalesforceOutputBulkExec.
The column names must be the same with salesforce.
Here is a topic related to this issue.
11987.
Regards,
Pedro
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

Pedro,
Thank you so much for your response. I compared the schemas and have found no differences between the input and output components. Can you tell me exactly which components you mean by the input component...do you mean the schema of my Task View in SQL? If so, I compared the structure of all of the fields in that schema as they appear in the Tmap to those that appear in the tSalesforceOutputBulkExec and they are identical.
I also tried remove the mapping of the one field (Task Comments field) and it works like a charm in batch, which tells me it is not something with the schema but something with the data? But I have no way of finding the offending record since it is not writing anything to a reject file. Any idea how to get it to write to a reject or tell you what record it bombed on?
Thanks, Cecilia
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

Hi Cecilia
I have imported your job and test a new tSalesforceOutputBulkExec job with your specified schema.
But your schema is against the Task schema of my salesforce(Image 2).
And I get the same error(Image 1).
If I use tSalesforceOutputBulkExec and my Task schema, the job works fine.
I don't know why...

What do you mean "remove the mapping of the one field (Task Comments field) and it works like a charm in batch"?
Regards,
Pedro
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

What I mean is in my Tmap I am populating the Task Description field with a field from my SQL Task View called Action Note. So I am thinking that there are bad characters perhaps in the data that is causing it to fail? I say this because when i remove the mapping of that field altogether, the job runs fine. Do you know of a function that can strip out any bad XML characters out of a text field? Since they are almost impossible to find, I'm wondering if a function like that would help to at least see if there are bad characters in the data?
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

I had the same issue and it was due to a field on the output schema that I had not mapped.
I removed it and it went away.
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

Hi Elcalvomike
Thanks for your feedback.
Regards,
Pedro
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

there is the TalendString.replaceSpecialCharForXML(""). Not sure if that will clear it.
The other option is to handle the data transformation in your sql view.
Lots of code on forums for how to create custom replace functions for this.
Cecilia, how are you handling lookups for whatid, whoid for this job?
I have struggled with this and have only come up with csv dumps and joins to reduce the api calls.
One Star

Re: tSalesforceOutputBulkExec Component Fails with Invalid Batch

when we are importing schema from salesforce importing option we will get these many (yellow highlighted columns) coming . Plz reply me ASAP ,thank you