Integration

Get Involved. Join the Conversation.

Topic

    Mike Harrison
    Salesforce Integration FinalBatch errorAnswered
    Topic posted July 24, 2019 by Mike HarrisonRed Ribbon: 250+ Points, tagged API, Integration, Salesforce 
    59 Views, 5 Comments
    Title:
    Salesforce Integration FinalBatch error
    Summary:
    Bulk Data load to Salesforce fails
    Content:

    Hi,

    I am trying to upload a CSV file to Salesforce through the Salesforce Adapter and the Bulk Data upsert operation. The upsert seems to work fine and generates the proper XML to send to salesforce, but when it reaches my FinalBatch operation, it fails with "invalid JobID" coming back from Salesforce.

    I am using a similar flow to what is shown in the Oracle documentation here:

    ttps://docs.oracle.com/en/cloud/paas/integration-cloud/sforce-adapter/handle-huge-data-sets-asynchronously-different-bulk-operations.html

    Attached is a picture of my integration flow. It fails at FinalBatch. The "mapping to FinalBatch" is not doing anything because there is nothing I can use from the upsert to send a jobID to the final batch operation. 

    Am I missing something? Do I need to create a Job ID first somehow? 

    This is the last part of the diagnostic log:

    ]]
    [2019-07-24T19:34:37.570+00:00] [oicyyz3I_server_2] [ERROR] [] [oracle.soa.adapter] [tid: [ACTIVE].ExecuteThread: '67' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xxxx] [ecid: 9287e245-2972-42c6-8df1-72487b165c7e-00196901,1:20730:3] [partition-name: DOMAIN] [tenant-name: GLOBAL] [oracle.soa.tracking.FlowId: 60] [oracle.soa.tracking.InstanceId: 3532] [oracle.soa.tracking.SCAEntityId: 434] [composite_name: SITE_ID_CATALOGUE!01.00.0000] [FlowId: 0000Mk_UItgEwG55zRs1yW1TA0NF0000pc] JCABinding <outbound> Integration Payload : [[
     <finalBatch xmlns="http://xmlns.oracle.com/cloud/adapter/salesforce/FinalBatch_REQUEST"/>

    ]]
    [2019-07-24T19:34:37.572+00:00] [oicyyz3I_server_2] [ERROR] [OSB-381990] [oracle.osb.transports.jca.jcatransport] [tid: [ACTIVE].ExecuteThread: '67' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xxxx] [ecid: 9287e245-2972-42c6-8df1-72487b165c7e-00196901,1:20730:3] [partition-name: DOMAIN] [tenant-name: GLOBAL] [oracle.soa.tracking.FlowId: 60] [oracle.soa.tracking.InstanceId: 3532] [oracle.soa.tracking.SCAEntityId: 434] [composite_name: SITE_ID_CATALOGUE!01.00.0000] [FlowId: 0000Mk_UItgEwG55zRs1yW1TA0NF0000pc] Invoke JCA outbound service failed with application error, exception: <genericRestFault><errorCode>400</errorCode><errorPath><![CDATA[POST https://xxxx.***.xx.my.salesforce.com/services/async/46.0/job/7503D0000039sPFQAY/batch returned a response status of 400 Bad Request]]></errorPath><instance><![CDATA[<?xml version="1.0" encoding="UTF-8"?><error[[
       xmlns="http://www.force.com/2009/06/asyncapi/dataload">
     <exceptionCode>InvalidJob</exceptionCode>
     <exceptionMessage>Invalid job id: 7503D0000039sPFQAY</exceptionMessage>
    </error>]]></instance></genericRestFault>
    ]]
    [2019-07-24T19:34:39.043+00:00] [oicyyz3I_server_2] [ERROR] [ESS-07004] [oracle.as.ess] [tid: ESS Execute Thread [RequestId:3581]] [userId: <WLS Kernel>] [ecid: 9287e245-2972-42c6-8df1-72487b165c7e-00196901,0:140:1:100009653] [APP: ESSAPP] [partition-name: DOMAIN] [tenant-name: GLOBAL] [ESS_JobMetadataID: JobDefinition://oracle/apps/ess/seeded/ics/IcsFlowJob] [ESS_RequestID: 3581] [FlowId: 0000Mk_UItgEwG55zRs1yW1TA0NF0000pc] [ESS_Module: Processor] Execution error for request 3581. Reason: ESS-07033 Job logic indicated a system error occurred while executing an asynchronous java job for request 3581. Job error is: com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault}[[
    messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
    parts: {{
    CODE=<code>{http://schemas.oracle.com/bpel/extension}remoteFault</code>
    ,SUMMARY=<summary>ICS runtime execution error</summary>
    ,DETAIL=<DETAIL><detail><ICSfaultVar/><reason>Error sending bytes: Sending salesforce batch file failed with an error.
    :Application Error</reason><operation>finalBatch</operation></detail></DETAIL>}
    cause: {null}
    .
    ]]

    Image:

    Best Comment

    Jyothirmayee X Maddela

    Hi Mike,

    Could you please check if you are using the same salesforce connection for the endpoint configured inside the stage and for the endpoint configured for final batch operation? 
    As the error which you are seeing might be due to the different connections which are pointing to two different instances.

    Thanks,

    Naga Mahesh.  

    Comment

     

    • Shalindra Singh

      Hi Mike,

      Error indicates that correct job id is not being mapped. Can you please check if you are mapping jobid or batch id. Can you please share the mapping file (mapped to finalBatch operation) with us for us to analyze it

      Thanks

      Shalindra Singh

      • Mike Harrison

        There's nothing to map to the final batch variables though. Even Oracle's documentation doesn't mention having to map anything before finalbatch operation. attached is the screenshot of what is in the mapper.

         

         

    • Jyothirmayee X Maddela

      Hi Mike,

      Could you please check if you are using the same salesforce connection for the endpoint configured inside the stage and for the endpoint configured for final batch operation? 
      As the error which you are seeing might be due to the different connections which are pointing to two different instances.

      Thanks,

      Naga Mahesh.  

      • Mike Harrison

        Well it turns out you were right, I was connecting to an incorrect instance of salesforce in the upsert call, so it didn't match the connection that final Batch was using. Once I fixed that, it all works.

        Thanks.

        • Shalindra Singh

          Good to see that it worked for you. 

          All these scenarios are tested multiple times and are working in production for customers. Steps are also verified. Feel free to leave your comments if you think something can be done to improve it further.

          Thanks

          Shalindra Singh