This document applies to Pega Platform™ versions 7.2 through 8.4, on-premises environments. It is not applicable to Pega Cloud® services environments, which are already configured to use the NIO connector.
Symptoms
When opening rules in Pega Dev Studio, App Studio, Admin Studio, Case Manager, or other Pega application portals, users see the InvalidStreamError and the application UI or the rules display incorrectly. This problem occurs when Pega application is deployed on the Apache Tomcat application server or the IBM WebSphere Application Server and it fails to give POST body to Pega Engine.
Errors
Error adopting XML from POST data:
com.pega.pegarules.pub.clipboard.InvalidStreamError: InvalidStream com.pega.pegarules.data.internal.clipboard.XMLStream.newStream(String, StorageStream) sax parse error: Content is not allowed in prolog.
Explanations
The Pega Engine throws SAXParserException as a side effect when the Engine receives an empty POST body from the underlying Tomcat or WebSphere Application Server container. An empty POST body means that request.getInputStream().read() returns 0 bytes.
The reason for receiving the empty POST body is unknown because it happens in the Tomcat code or WebSphere Application Server code.
With Tomcat, the Apache Portable Runtime (APR) protocol comes into play. This issue does not happen with the NIO connector protocol. Therefore, to overcome this exception, system administrators need to change the connector protocol from Apache Portable Runtime (APR) protocol to the NIO protocol.
Solution
To avoid the error message SAXParserException
displayed in logs, apply the solution for the application server that you are using.
Apache Tomcat server
When the Tomcat container returns an empty POST body to the engine, do not use the APR connector protocol. Instead, use the correct NIO protocol for the Tomcat version.
See Apache Tomcat 9 Configuration Reference (9.0.76) - The HTTP Connector > NIO specific configuration
IBM WebSphere Application Server
When the WebSphere Application Server container returns an empty POST body to the engine, edit the server.xml file and set the value of the following property to true:
<webContainer enablemultireadofpostdata="true" />
No protocol changes are required for WebSphere Application Server.
For more information, see the IBM WebSphere Application Server documentation for the version that you are using, for example, Configuring Liberty web applications to reread POST data - IBM Documentation.