I have a project that is build with Maven, and ends up creating a WAR. The War is deployed to a Tomcat 7 server. When I attempt to create a JasperReport, I get the following error. Does anyone know the solution to this? The JasperReports depenedency includes that file in question. I am currently using JasperReports 4.1.2, and even remains in 4.6.0.
net.sf.jasperreports.engine.JRException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 422; schema_reference.4: Failed to read schema document 'tomcat-7/work/Catalina/loader/net/sf/jasperreports/engine/dtds/jasperreport.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:247)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:230)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:218)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:196)
at GeneralReport.processRequest(GeneralReport.java:80)
at GeneralReport.doGet(GeneralReport.java:140)
at javax.servlet.http.HttpServlet.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(Unknown Source)
The problem I had was due to NetBeans, and Tomcat7. Netbeans starts up tomcat with a scratch directory that is Catalina/work. With the default install of tomcat, that is not setup under that directory. I believe it is /var/tmp/tomcat7. But anyways, Netbeans is set in it’s ways. So to fix that, create a work directory under the catalina folder and then allow for full user/group privilleges here.
How this related to JasperReports: The dependency could not get deployed to the directory that it was expecting.