Exception in TIBCO BusinessWorks ProcessMonitor (BWPM) due to a NULL character in XML during parsing, resulting in a crash of BWPM.

Exception in TIBCO BusinessWorks ProcessMonitor (BWPM) due to a NULL character in XML during parsing, resulting in a crash of BWPM.

book

Article ID: KB0093783

calendar_today

Updated On:

Products Versions
TIBCO BusinessWorks ProcessMonitor -
Not Applicable -

Description

Description:
When using the parse XML activity in TIBCO ActiveMatrix BusinessWorks (BW) code, it does not set the proper encoding settings as per XML content. The error "An invalid XML character (Unicode: 0x0) was found in the element content of the document" is reported in the server log. During processing of such a messages, data providers fail to parse the XML and exceptions are seen in the server log and BWPM functionality is affected.

Symptoms:

1). JMS messages have several invalid <?tibco-char 0?> strings.


2). The following exception is seen in the server logs:


[org.xml.sax.SAXParseException; lineNumber: 11; columnNumber: 278; An invalid XML character (Unicode: 0x0) was found in the element content of the document.]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown Source)
Caused by: javax.xml.bind.UnmarshalException


3). The functionality of BWPM is hampered because the messages on the EMS server are not being processed by the data providers.



Cause:
If the XML input file and parse activity has different encoding in the TIBCO ActiveMatrix BusinessWorks (BW) code, (i.e., the input file has UTF-16 encoding, the BW activity(parse XML) is configured with UTF-8), the missing bytes are replaced with NULL characters (0x0). This character is escaped as <?tibco-char 0?>. The XML file has a value containing NULL characters (0x0) which is an invalid character. When data providers try to process event messages containing invalid XML, it fails with the error, "An invalid XML character (Unicode: 0x0) was found in the element content of the document".

Issue/Introduction

Exception in TIBCO BusinessWorks ProcessMonitor (BWPM) due to a NULL character in XML during parsing, resulting in a crash of BWPM.

Resolution

There are two workarounds for this issue.

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 file 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 as shown in the attached screenshot (Filename: 
normalizeUTF16toUTF8.JPG).

 

Attachments

Exception in TIBCO BusinessWorks ProcessMonitor (BWPM) due to a NULL character in XML during parsing, resulting in a crash of BWPM. get_app