marcoarf Posted April 24, 2009 Share Posted April 24, 2009 Hello everyone!I'm marco, i'm new with jasper's world and with Java.I'm trying to create my first report in Java, but right at the beginning "JRXmlLoader.load(IfileName);"i get this error:net.sf.jasperreports.engine.JRRuntimeException: Could not find resource net/sf/jasperreports/engine/dtds/jasperreport.xsd at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.getResourceURI(JRReportSaxParserFactory.java:194) at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.getSchemaLocations(JRReportSaxParserFactory.java:159) at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.configureParser(JRReportSaxParserFactory.java:143) at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.createParser(JRReportSaxParserFactory.java:108) at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(JRXmlDigesterFactory.java:1303) at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1278) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168) at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152) at TableApp.NotesMain(TableApp.java:47) at lotus.domino.AgentBase.runNotes(Unknown Source) at lotus.domino.NotesThread.run(Unknown Source)I really can't understand what's wrong, the jasperreport.xsd file is in the "jasperreports-3.5.0.jar"...Please, anyone could help me?what should i do? Thanks everyone . ByeMarco Code:import lotus.domino.*;import java.io.File;import net.sf.jasperreports.engine.JREmptyDataSource;import net.sf.jasperreports.engine.JRException;import net.sf.jasperreports.engine.JRExporterParameter;import net.sf.jasperreports.engine.JasperCompileManager;import net.sf.jasperreports.engine.design.JRCompiler;import net.sf.jasperreports.engine.design.JasperDesign;import net.sf.jasperreports.engine.xml.JRXmlLoader;import net.sf.jasperreports.engine.JasperReport;import java.sql.Connection;import net.sf.jasperreports.engine.JasperExportManager;import net.sf.jasperreports.engine.JasperFillManager;import net.sf.jasperreports.engine.JasperPrint;import net.sf.jasperreports.engine.JasperPrintManager;import net.sf.jasperreports.engine.JasperRunManager;import net.sf.jasperreports.engine.export.JExcelApiExporter;import net.sf.jasperreports.engine.export.JRCsvExporter;import net.sf.jasperreports.engine.export.JRRtfExporter;import net.sf.jasperreports.engine.export.JRXlsExporter;import net.sf.jasperreports.engine.export.JRXlsExporterParameter;import net.sf.jasperreports.engine.export.oasis.JROdtExporter;import net.sf.jasperreports.engine.util.JRLoader; public class TableApp extends AgentBase { public void NotesMain() { String IfileName = "c:\\articolo.jrxml"; try { JasperDesign jasperDesign = JRXmlLoader.load(IfileName); } catch(Exception e) { e.printStackTrace(); } }} Link to comment Share on other sites More sharing options...
gmasterb Posted May 15, 2009 Share Posted May 15, 2009 The same for me...did you found an answer? regards Link to comment Share on other sites More sharing options...
andfedotov Posted May 15, 2009 Share Posted May 15, 2009 Well, that's strange. I have no such issue. Try with jasperreports-3.5.1, although schema validation was introduced at version 3.1.0 Take a closer look at your classpath... Link to comment Share on other sites More sharing options...
gmasterb Posted May 18, 2009 Share Posted May 18, 2009 classpath looks fineit seems to be an classloader issue for domino.one possible fix is to compile your report out of domino an provide the compiled .jasper file. Another problem is that IReport creates a new ClassLoader instance for the Evaluators.So we have to adapt the java.policy file permission java.lang.RuntimePermission "createClassLoader"; permission java.lang.RuntimePermission "getProtectionDomain"; // permission java.lang.RuntimePermission "modifyThreadGroup"; // permission java.lang.RuntimePermission "modifyThread"; but what do in a custumers environment?see also http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=56954 regards GMasterBPost Edited by gmasterb at 05/18/2009 08:20 Link to comment Share on other sites More sharing options...
marcoarf Posted May 18, 2009 Author Share Posted May 18, 2009 hey, good news! i sorted it out!Don't ask me why, but now it is working:i used to add all the jar in the JAVA agent, now I removed the jar from the agent and i phisically put all the jars in the directory jvm/lib/ext..restart server and smile !don't forget to change the permission in the java.security if u want to write file in the hard disk!i hope this can fix your troubles as well! P.S.you can find the original jar's list in the zip of the project jasper report.... there's a folder within everything u need ! Link to comment Share on other sites More sharing options...
gmasterb Posted May 19, 2009 Share Posted May 19, 2009 ok, that's a temporarily solution. but what if you have to serve a customers environment? it's impossible to deploy jar files into the server infrastructure... 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