Skip to main content
LinkedIn
Copied!

Table of Contents

Troubleshooting Error adopting from POST body SAXParserException: Content is not allowed in Prolog

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 either the NIO or NIO2 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 or NIO2 protocol for the Tomcat version.

Perform the following local change by editing the Tomcat server.xml file:

For Tomcat version 9 and later versions, change the connector protocol to NIO2, as shown in the following example:

Use < Connector protocol="org.apache.coyote.http11.Http11Nio2Protocol" >

https://tomcat.apache.org/tomcat-9.0-doc/config/http.html

For Tomcat version 8, change the connector protocol to NIO2, as shown in the following example:

              Use < Connector protocol="org.apache.coyote.http11.Http11Nio2Protocol" >

https://tomcat.apache.org/tomcat-8.0-doc/config/http.html

For Tomcat version 7.0.88, change the connector protocol to NIO, as shown in the following example:

Use < Connector protocol="org.apache.coyote.http11.Http11NioProtocol" >

https://tomcat.apache.org/tomcat-7.0-doc/config/http.html

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.

 

 

 

 

Did you find this content helpful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us