[ https://issues.apache.org/jira/browse/XALANJ-2537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028159#comment-13028159 ]
Mukul Gandhi commented on XALANJ-2537: -------------------------------------- Have you tried tuning the JVM (for example with -Xmx option)? You may hope, that this may solve your memory size problems. If you use 64 bit JVM, then you're very lucky for such problems, where you can allocate more memory to the JVM. Memory limits for a given hardware usually should not be classified as a bug in the application. For e.g, if somebody is using very less RAM (say 64 MB as an example!) on the host, and run-time process fails due to memory constraints, then to my opinion that usually cannot be classified as a bug in the application. > The SAX exception occurs in Tansformer.transform() for a very large xml > string as input. > ----------------------------------------------------------------------------------------- > > Key: XALANJ-2537 > URL: https://issues.apache.org/jira/browse/XALANJ-2537 > Project: XalanJ2 > Issue Type: Bug > Security Level: No security risk; visible to anyone(Ordinary problems in > Xalan projects. Anybody can view the issue.) > Components: SAX > Affects Versions: 2.7 > Environment: Linux > Reporter: Deepthi BakkaVemana > Priority: Blocker > Labels: sax_exception_for_Largexml > > We are using xalan 2.7.0 and fop 0.95 for generating PDF reports.While > generating pdf report for a large xml string of 2,96,126 characters(~ nearly > 3 lakh characters) ,the PDF generation fails and it fails at > transformer.transform() method in TransformerImpl.java.Since in our > product,we need large reports with very large strings(events),we need this > fix ASAP. > I et the below exception: javax.xml.transform.TransformerException: > org.xml.sax.SAXException: Mismatch: page-sequence > (http://www.w3.org/1999/XSL/Format) vs. root > (http://www.w3.org/1999/XSL/Format) > at > org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725) > at > org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2243) > at > org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2069) > at > org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1171) > at > org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:634) > at > org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088) > at > org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066) > at > com.ca.calm.reporter.pdf.PDFGenerator.buildPdf(PDFGenerator.java:1312) > at > com.ca.calm.reporter.pdf.PDFGenerator.generatePdfForQueryView(PDFGenerator.java:1240) > at > com.ca.calm.reporter.pdf.PDFGenerator.exportPanel(PDFGenerator.java:186) > at calmReporter.exportPanel(calmReporter.java:421) > at calmReporter.handleRequest(calmReporter.java:161) > our code: > TransformerFactory factory = TransformerFactory.newInstance(); > Templates templates = factory.newTemplates(new > SAXSource(new InputSource( > new StringReader(xslContent)))); > Transformer transformer = templates.newTransformer(); > // Set the value of a <param> in the stylesheet > transformer.setParameter("versionParam", "2.0"); > Result res = new SAXResult(fop.getDefaultHandler()); > String parserClass = > "com.sun.org.apache.xerces.internal.parsers.SAXParser"; > if (((String) > System.getProperties().get("java.version")).startsWith("1.4")) > { > parserClass = > "org.apache.crimson.parser.XMLReaderImpl"; > } > //String parserClass = > "org.apache.crimson.parser.XMLReaderImpl"; > XMLReader reader = > XMLReaderFactory.createXMLReader(parserClass); > Source source = new SAXSource(reader, new > InputSource(bufferedInputStream)); > transformer.transform(source, res); - this is the > point of failure.. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org For additional commands, e-mail: xalan-dev-h...@xml.apache.org