In earlier versions, XmlToPdf returned a status code of 1, indicating that an error has occurred in the XmlToPdf jar. However, SAMPro treated an error as a success because it does not read what the returned status code is.
Version 9.1.611.045 extends the XmlToPdf error handling to give a number of different status codes depending on where the error was encountered and what type of error it was, and update the reportMakePDF method to be able to know what the status code indicates and log the error to a new XmlToPdf.log file in the root SAMPro directory.
The xmltopdf.jar file dated 2018-03-15 (or higher) must be used to see the xmltopdf.log file updated.
XmltoPdf Errors:
1 DOM Error while processing XML file header @SPReport.initParameters()
-DOMException while processing XML header.
2 Number Format Error while processing XML File Header @SPReport.initParameters()
-NumberFormatException while processing XML Header.
3 Error Processing Report Body @SPReport.documentIncludesReport()
-Error Processing body tags.
4 Error Processing report Body @SPReport.processBody()
- Error processing body tags.
5 Error processing page @SPReport.processPage()
-Error Processing fields in pages.
6 No arguments passed into the jar @XmlToPdf.processArguments()
-No files were passed into the java command line.
7 Error initilizaing log file @XmlToPdf.initLogFile()
-The log file in the base directory could not be created for some reason. Permissions, locked file, etc.
8 SAX Parse Error reading xml doc @XmlToPdf.getXmlDoc()
-SAXParseException parsing xml doc. XML may be improperly formatted.
9 SAX Error reading xml doc @XmlToPdf.getXmlDoc()
-SAXException parsing xml doc. XML may be improperly formatted.
10 IO Error reading xml doc @XmlToPdf.getXmlDoc()
-IOException parsing xml doc.
11 Error opening xml doc and creating pdf document. @XmlToPdf.getPdfDoc()
-Exception while opening the xml document and getting page orientation and head tag.
12 Output File Not Found Error @XmlToPdf.getPdfWriter()
-FileNotFoundException when creating FileOutputStream for the PDF writer.
13 Document Error in the PDF Writer @XmlToPdf.getPdfWriter()
-DocumentException when creating the PDF writer.
14 Error: This is not a valid report file @XmlToPdf.checkForValidReport()
-The specified report xml file is not in the correct format.
15 IO Error creating temp file @XmlToPdf.getTempFilename()
-Error creating the temp file in the base directory. The file may already exist and be open by another process or it may be a permissions issue.
16 Could not move temp file to pdf file path @XmlToPdf.createReport()
-The temp file could not be moved into the pdf file path. The file may already exist and be open by another process or it may be a permissions issue.
17 Error sending email using Outlook. Moving files to failed folder. @SPReport.sendEmail()
-An error occurred when trying to open Outlook to send an email. Moving directly to the failed folder.
18 Error sending email using Java. Moving files to retry folder. @SPReport.sendEmail()
-An error occurred when trying to contact the SMTP server or send an email. Will retry.
19 Error sending email using Java (retry). Moving files to failed folder. Sent failure emails. @SPReport.sendEmail()
-An error occured when trying to contact the SMTP server or send an email. Will not retry. Failure emails sent to sender and SMTP user.
20 Error sending email using Java (retry). Moving files to failed folder. Failure Email to SENDER failed. @SPReport.sendEmail()
-An error occured when trying to contact the SMTP server or send an email. Will not retry. Failure email to the sender did not send.
21 Error sending email using Java (retry). Moving files to failed folder. Failure Email to SMTPUser failed. @SPReport.sendEmail()
-An error occured when trying to contact the SMTP server or send an email. Will not retry. Failure email to the SMTP User did not send.
22 Error sending email using Java (retry). Moving files to failed folder. Failure Emails unsuccessful. @SPReport.sendEmail()
-An error occured when trying to contact the SMTP server or send an email. Will not retry. Both failure emails did not send.