I'm getting errors when trying to refresh the form with <f:ajax render="@form" listener="#{myBean.onSelectItemChange}" />
The message in the popup is "emptyResponse: An empty response was received from the server. Check server error logs."
In Firefox console, the error is "XML Parsing Error: XML or text declaration not at start of entity Location"
The same code works well in my local environment. I use Tomcat 9 in both local and production environments. I'm getting errors only in production.
The xhtml page starts with
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
When rendered, the <!DOCTYPE html>is added automatically at the top of the page.
I've also tried adding <?xml version="1.0" encoding="UTF-8"?> on the top of the page.
Edit: To be more specific on error: XML Parsing Error: XML or text declaration not at start of entity Location: http://serverIP:8080/app/myPage Line Number 2, Column 1:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
UPDATE: The XHR response looks like this:
<?xml version='1.0' encoding='UTF-8'?>
<?xml version='1.0' encoding='UTF-8'?>
<partial-response>
...
</partial-response>
The first line is repeated twice
By the way, the app is working correctly on my development environment. I'm using Tomcat9 on both development(Windows) and production (Ubuntu) computers.