Receiving junk values(<?tibco-char 0?>) as output in LDAP Adapter
book
Article ID: KB0082472
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix Adapter for LDAP
6.1.1
Description
While using LDAP Adapter, we might receive junk values(<?tibco-char 0?>) as output along with required values from LDAP Adapter subscriber. Due to this, we will be unable to parse the value from TIBCO further and it will throw below error: 'java.lang.IllegalArgumentException: Char 0x0 cannot be used in XML'
Issue/Introduction
Receiving junk values() as output in LDAP Adapter
Environment
All OS
TIBCO ActiveMatrix BusinessWorks 5.13+ LDAP Adapter 6.1.1
Resolution
This issue is caused when the input data and Tibco activity has different encoding in the TIBCO ActiveMatrix BusinessWorks (BW) code, (i.e., the input data has UTF-16 encoding, the BW activity is configured with UTF-8), the missing bytes are replaced with NULL characters (0x0). This character is escaped as <?tibco-char 0?>.
When data providers try to process event messages containing invalid XML, it fails with the error, "'java.lang.IllegalArgumentException: Char 0x0 cannot be used in XML' Error."
There are 2 workarounds for this:
1). Use the right encoding, i.e., match the encoding of the XML input file and the parse activity in TIBCO ActiveMatrix BusinessWorks code so as to avoid NULL characters.
2). In case different encoding needs to be used (e.g., the input data should have UTF-16 encoding but the BW activity is configured with UTF-8), the NULL characters have to be removed for a direct copy-of mapping. You can use the normalize-space() XPATH function. After using normalize-space function, the junk data will not be present because this function normalizes stripping and trailing whitespaces and replace the sequence of whitespace chars by a single space.
Please find the correct encoding of the input data and set the BW to that encoding. This will resolve this issue or you can try using normalize-space function.