Resulting in the following logs in system error every time:
[Fatal Error] :1:1: Content is not allowed in prolog.
This message is written by Xerces (included in the JDK), as a result of the following code in DomUtils:
public static boolean isDOM(final byte[] bytes) {
try {
final Document dom = buildDOM(bytes);
return dom != null;
} catch (DSSException e) {
// NOT DOM
return false;
}
}
The question is, why do you try to parse application/pdf binary content as XML?
If you still do, then please ensure no misleading errors are printed that people need to investigate...