We run Prince over Apache Tomcat using the Java API mentioned here at http://www.princexml.com/doc/java/api/.
Our code snippet looks like:
However we get HTTP 500 Error for around 50 requests per 1000 requests. Our basic analysis shows that retrying it later on has resolved the issue for many PDF's. So it looks like its not the data that is causing the issue. I have seen Prince XML giving output for most HTML's.
How do I understand the HTTP 500 Error better? How do I get Prince to log the errors? Does Prince enable logging by default or do I have to specify it? If so how would I go about it? Something like this be fine?
Our code snippet looks like:
final Prince prince = new Prince(context.getInitParameter("princexml.execpath"));
try {
prince.setHTML(true);
prince.convert(input, out);
}
catch (IOException e)
{
throw new WebApplicationException(Response.status(Status.BAD_REQUEST)
.entity("Error creating PDF from input." + " (" + e.getMessage() + ")").build());
}
However we get HTTP 500 Error for around 50 requests per 1000 requests. Our basic analysis shows that retrying it later on has resolved the issue for many PDF's. So it looks like its not the data that is causing the issue. I have seen Prince XML giving output for most HTML's.
How do I understand the HTTP 500 Error better? How do I get Prince to log the errors? Does Prince enable logging by default or do I have to specify it? If so how would I go about it? Something like this be fine?
prince.setDebug(true);
prince.setLog("/var/log/prince.log");
...
...
prince.convert(input,out);