Error when File Adapter parses an XML file using UTF-8 encoding in SOA Suite 12.2.1.0.0

Issue –> Got the below error when file adapter parses an xml using utf-8 ecoding

Error –>

summary=<summary>Exception occurred when binding was invoked.
Exception occurred during invocation of JCA binding: “JCA Binding execute of Reference operation ‘SynchRead’ failed due to: Error while translating.
Translation exception.
Error occurred while translating content from file <file>
Please make sure that the file content conforms to the schema. Make necessary changes to the file content or the schema.
“.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
</summary>
,code=<code>null</code>
,detail=<detail>Start of root element expected.</detail>}> 

Cause –> This is due to the adapter trying to read the XML file as UTF-8. The file was edited using Notepad which saves files as UTF-8 with BOM (Byte Order Mark) even though it doesn’t show the BOM in the Notepad window.

Solution –>

To resolve this issue, several approaches may be taken:

1. If wanting to use input files encoded without BOM:

A. Use a superior file editor (such as Notepad++) to save the input file. This allows the user to save files as “Encode in UTF-8” or “Encode in UTF-8-BOM”.

2. If wanting to use input files encoded with BOM or using Notepad to save files encoded with UTF-8:

A. The native schema information needs to be added and set to “true” in the input schema.

Advertisements

2 thoughts on “Error when File Adapter parses an XML file using UTF-8 encoding in SOA Suite 12.2.1.0.0

  1. i want solution in osb to removing bom , i don’t want to use noterpadd+ , could you please provide the best apporach ?

    Like

  2. We can not remove the format in OSB, this we have to do it when creating the file itself.

    To remove the byte order mark you can use a hex editor or .
    A simpler solution is the following:
    In Notepad++ goto encoding and click “convert to UTF-8 without BOM.

    If you want to use the file with same format then native schema information needs to be added and set to “true” in the input schema.

    Follow the below document to process files with BOM.

    https://docs.oracle.com/middleware/1221/adapters/develop-soa-adapters/GUID-68CAF434-C45D-4B8B-A7FC-2F907FA4CD21.htm#TKADP9048

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s