jacky Posted October 18, 2006 Share Posted October 18, 2006 I got an error when i compiled the .jrxml: log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester).log4j:WARN Please initialize the log4j system properly.org.xml.sax.SAXParseException: URI was not reported to parser for entity [document] at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934) at gnu.xml.aelfred2.SAXDriver.startExternalEntity(SAXDriver.java:631) at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3358) at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:159) at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320) at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294) at org.apache.commons.digester.Digester.parse(Digester.java:1647) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142) at jasperReport.compileJrxml.main(compileJrxml.java:32) NESTED BY :org.xml.sax.SAXParseException: URI was not reported to parser for entity [document] at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934) at gnu.xml.aelfred2.SAXDriver.startExternalEntity(SAXDriver.java:631) at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3358) at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:159) at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320) at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294) at org.apache.commons.digester.Digester.parse(Digester.java:1647) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142) at jasperReport.compileJrxml.main(compileJrxml.java:32):( what's the reason?pls help me and thanks a lot. Link to comment Share on other sites More sharing options...
jacky Posted October 18, 2006 Author Share Posted October 18, 2006 and the .java is:package jasperReport; import java.util.HashMap; import net.sf.jasperreports.engine.JREmptyDataSource;import net.sf.jasperreports.engine.JRException;import net.sf.jasperreports.engine.JasperCompileManager;import net.sf.jasperreports.engine.JasperExportManager;import net.sf.jasperreports.engine.JasperFillManager;import net.sf.jasperreports.engine.JasperPrint;import net.sf.jasperreports.engine.JasperReport;import org.apache.commons.digester.Digester.*; public class compileJrxml { public static void main(String[] args) { JasperReport jasperReport; JasperPrint jasperPrint; String xmlFileName = "D:/jasperreport/jasperreports-1.2.7-project/jasperreports-1.2.7/demo/samples/horizontal/HorizontalReport.jrxml"; String srcDirName = "D:/jasperreport/jasperreports-1.2.7-project/jasperreports-1.2.7/demo/samples/horizontal/"; try { jasperReport = JasperCompileManager.compileReport(xmlFileName); jasperPrint = JasperFillManager.fillReport(jasperReport, new HashMap(), new JREmptyDataSource()); JasperExportManager.exportReportToPdfFile(jasperPrint, srcDirName); } catch (JRException e) { e.printStackTrace(); } } } Link to comment Share on other sites More sharing options...
jacky Posted October 18, 2006 Author Share Posted October 18, 2006 YES.It works now when I copied the jars from jasperreport sample lib to my project lib. Link to comment Share on other sites More sharing options...
eman_magdy Posted March 21, 2012 Share Posted March 21, 2012 jackyWrote: I got an error when i compiled the .jrxml: log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester). log4j:WARN Please initialize the log4j system properly. org.xml.sax.SAXParseException: URI was not reported to parser for entity [document] at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934) at gnu.xml.aelfred2.SAXDriver.startExternalEntity(SAXDriver.java:631) at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3358) at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:159) at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320) at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294) at org.apache.commons.digester.Digester.parse(Digester.java:1647) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142) at jasperReport.compileJrxml.main(compileJrxml.java:32) NESTED BY : org.xml.sax.SAXParseException: URI was not reported to parser for entity [document] at gnu.xml.aelfred2.SAXDriver.warn(SAXDriver.java:934) at gnu.xml.aelfred2.SAXDriver.startExternalEntity(SAXDriver.java:631) at gnu.xml.aelfred2.XmlParser.pushURL(XmlParser.java:3358) at gnu.xml.aelfred2.XmlParser.doParse(XmlParser.java:159) at gnu.xml.aelfred2.SAXDriver.parse(SAXDriver.java:320) at gnu.xml.aelfred2.XmlReader.parse(XmlReader.java:294) at org.apache.commons.digester.Digester.parse(Digester.java:1647) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238) at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142) at jasperReport.compileJrxml.main(compileJrxml.java:32) :( what's the reason?pls help me and thanks a lot. Link to comment Share on other sites More sharing options...
eman_magdy Posted March 21, 2012 Share Posted March 21, 2012 I got an warn when i run the following code log4j:WARN No appenders could be found for logger (net.sf.jasperreports.extensions.ExtensionsEnvironment). please help me Code:import net.sf.jasperreports.engine.*;import net.sf.jasperreports.engine.export.*;import java.util.*;public class JasperTest { public static void main(String[] args) { String fileName = "D:\application\projects\reports\test1.jasper"; String outFileName = "D:\application\projects\reports\test1.pdf"; HashMap hm = new HashMap(); try { // Fill the report using an empty data source JasperPrint print = JasperFillManager.fillReport(fileName, hm, new JREmptyDataSource()); // Create a PDF exporter JRExporter exporter = new JRPdfExporter(); // Configure the exporter (set output file name and print object) exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName); exporter.setParameter(JRExporterParameter.JASPER_PRINT, print); // Export the PDF file exporter.exportReport(); } catch (JRException e) { e.printStackTrace(); System.exit(1); } catch (Exception e) { e.printStackTrace(); System.exit(1); } }} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now