JFreeReport error when missing the "JFreeReportBoot.getInstance().start()"...

Discussion in 'Java' started by Brian, Jun 25, 2009.

  1. Brian

    Brian Guest

    This post is just to document an issue I had trying to get JFreeReport
    to run, seems there is lack of postings about this issue. If you get
    the error below then it means you just need to add the following line
    "JFreeReportBoot.getInstance().start();" before you can call the
    JFreeReport API...

    Source:
    ReportGenerator generator = ReportGenerator.getInstance();
    File f = new File("C:\\mytemplate.xml");
    JFreeReport report = generator.parseReport(f);

    Error:
    org.jfree.resourceloader.ResourceCreationException: Unable to parse
    the document
    at org.jfree.xmlns.parser.AbstractXmlResourceFactory.create
    (AbstractXmlResourceFactory.java:214)
    at org.jfree.resourceloader.ResourceManager.performCreate
    (ResourceManager.java:454)
    at org.jfree.resourceloader.ResourceManager.create
    (ResourceManager.java:383)
    at org.jfree.resourceloader.ResourceManager.create
    (ResourceManager.java:329)
    at org.jfree.report.modules.parser.base.ReportGenerator.parseReport
    (ReportGenerator.java:275)
    at com.sscims.casetracker.TestWorker.main(TestWorker.java:26)
    ParentException:
    org.xml.sax.SAXException: No suitable root handler known for this
    document: XmlDocumentInfo={rootElementTag=report, rootElementNS=,
    SystemDTD-ID=file:/C:/CURRENT/WSB/InquiryManagementWeb/WebRoot/
    templates/report-085.dtd, PublicDTD-ID=-//JFreeReport//DTD report
    definition//EN//simple/version 0.8.5, defaultnamespace=}
    at
    org.jfree.xmlns.parser.MultiplexRootElementHandler.interceptFirstStartElement
    (MultiplexRootElementHandler.java:173)
    at org.jfree.xmlns.parser.RootXmlReadHandler.startElement
    (RootXmlReadHandler.java:387)
    at
    com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement
    (AbstractSAXParser.java:533)
    at
    com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement
    (XMLDTDValidator.java:798)
    at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement
    (XMLNSDocumentScannerImpl.java:330)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl
    $NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:
    779)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
    $FragmentContentDispatcher.dispatch
    (XMLDocumentFragmentScannerImpl.java:1794)
    at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
    (XMLDocumentFragmentScannerImpl.java:368)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
    (XML11Configuration.java:834)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse
    (XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse
    (XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse
    (AbstractSAXParser.java:1242)
    at org.jfree.xmlns.parser.AbstractXmlResourceFactory.create
    (AbstractXmlResourceFactory.java:200)
    at org.jfree.resourceloader.ResourceManager.performCreate
    (ResourceManager.java:454)
    at org.jfree.resourceloader.ResourceManager.create
    (ResourceManager.java:383)
    at org.jfree.resourceloader.ResourceManager.create
    (ResourceManager.java:329)
    at org.jfree.report.modules.parser.base.ReportGenerator.parseReport
    (ReportGenerator.java:275)
    at com.sscims.casetracker.TestWorker.main(TestWorker.java:26)

    Fix:
    JFreeReportBoot.getInstance().start();
    ReportGenerator generator = ReportGenerator.getInstance();
    File f = new File("C:\\mytemplate.xml");
    JFreeReport report = generator.parseReport(f);
    Brian, Jun 25, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hiranya Samarasekera
    Replies:
    0
    Views:
    797
    Hiranya Samarasekera
    Nov 14, 2003
  2. CL
    Replies:
    1
    Views:
    3,512
    Raphael Bauduin
    Mar 6, 2004
  3. Subhasish Saha
    Replies:
    0
    Views:
    359
    Subhasish Saha
    Aug 9, 2004
  4. Brian
    Replies:
    0
    Views:
    1,663
    Brian
    Jun 14, 2005
  5. Gary Herron
    Replies:
    2
    Views:
    651
    Bruno Desthuilliers
    Jul 4, 2006
Loading...

Share This Page