Friday, December 4, 2020

ISG Rest Web Service – 500 Internal Server Error Exception

 Symptom/Problem/Error:

When a REST Web Service is invoked, the system immediately return Error Response mentioning “Error 500--Internal Server Error

<html>
   <head>
      <meta content="HTML Tidy for Java (vers. 26 Sep 2004), see www.w3.org" name="generator"/>
      <title>Error 500--Internal Server Error</title>
   </head>
   <body bgcolor="white">
      <font face="Helvetica">
         <br clear="all"/>
      </font>
      <table cellspacing="5" border="0">
         <tr>
            <td>
               <br clear="all"/>
               <h2>
                  <font size="3" color="black" face="Helvetica">Error 500--Internal Server Error</font>
               </h2>
            </td>
         </tr>
      </table>
      <table cellpadding="10" width="100%" border="0">
         <tr>
            <td bgcolor="white" width="100%" valign="top">
               <h3>
                  <font face="Courier New">
                     <font size="3" face="Helvetica">
                        From RFC 2068
                        <i>Hypertext Transfer Protocol -- HTTP/1.1</i>

The error can happen from SOAP UI, Postman or EBS ISG Test Client as well.

The same error can happen when the input XML is not properly parsed. But the error explained here is unrelated.

This typically happen when the service is invoked several times and very frequently. Due to some internal issue, EBS create multiple records in the resultant table.

 

Cause:

Duplicate records are created in “fnd_log_transaction_context” table due to Oracle EBS Bug.

Solution:

Step 1: Get Class ID of Problem Web Service

SELECT FSS.SERVICE_ALIAS, FSS.WSDL_URL, FSS.CLASS_ID, TO_CHAR(FSS.CREATION_DATE,'YYYY-MON-DD') AS CREATED_DATE,
    ICL.CLASS_NAME, ICL.IREP_NAME, ICL.CLASS_TYPE, ICL.PRODUCT_CODE, ICL.SOURCE_FILE_PATH, ICL.SOURCE_FILE_NAME, ICL.DISPLAY_NAME
FROM APPS.FND_SOA_SERVICES FSS, FND_IREP_CLASSES_VL ICL
WHERE FSS.WSDL_URL LIKE '%<Service Name>%%'
AND FSS.CLASS_ID = ICL.CLASS_ID(+)
--AND WSDL_URL LIKE '%/rest/%'   -- get only RESTful Web Services
ORDER BY FSS.SERVICE_ALIAS;

 

Step 2: Identify any service that has created duplicate records in FND LOG Transaction Context (fnd_log_transaction_context) table

select transaction_id, count(*)
from fnd_log_transaction_context
where transaction_type = 'SOA_INSTANCE'
group by transaction_id
having count(*) > 1;

 

Step 3: Delete the records: Replace the transaction_id in query below from the able query results.

DELETE from fnd_log_transaction_context
where transaction_type = 'SOA_INSTANCE'
and transaction_id = < transaction_id>;

 

System will automatically create new record in the table, when the web service is invoked first time after deletion.

No bouncing or Functional Admin Cache Clearing is required for this solution.


Keywords:

Oracle EBS, SOAP, fnd_log_transaction_context, REST, Web Service, R12, R12.2.8 Release, ISG, Integrated SOA Gateway, SOAP UI, Postman, WS