Could not instantiate SAX2 parser in Java
I am using iTest lib for Conversion of html to pdf My code is
String File_To_Convert = inputFilename;
String url = new File(File_To_Convert).toURI().toURL().toString();
System.out.println(""+url);
String HTML_TO_PDF = outputFilename;
OutputStream os = new FileOutputStream(HTML_TO_PDF);
ITextRenderer renderer = new ITextRenderer();
renderer.setDocument(url);
renderer.layout();
renderer.createPDF(os);
os.close();
It is working fine as a standalone program. But when I deployed it on my
jboss server. It gives me error like
org.xhtmlrenderer.util.XRRuntimeException: Could not instantiate any SAX 2
parser, including JDK default. The name of the class to use should have
been read from the org.xml.sax.driver System property, which is set to:
I have added this below line in run.config.bat file.
-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser
I am still getting the error.Any suggestions ?
No comments:
Post a Comment