Cannot Get .jrxml Template report from jar file in java application
Hi guys,
I have created a java desktop app wich uses iReport plugin. All works fine until I try to run my app from the own jar file app.
It cannot get my jrxml templates to make the reports with data obteined from a database. Obviously, these jrxml templates are located in the corresponding jar files inside my jar application.
If I run my app from IDE then it works fine and the report is perfectly created.
I have been searching for this one from last 2 days ... Till Now i didnt get any solution...
Re: Cannot Get .jrxml Template report from jar file in java application
Are there any error messages? Please copy the full text of any error messages and post them here.
Re: Cannot Get .jrxml Template report from jar file in java application
Quote:
Originally Posted by
Norm
Are there any error messages? Please copy the full text of any error messages and post them here.
Hi,
I am getting...
D:\>java -jar DFMPro_Report_Generator.jar 123 D:\MBRDI\MBRDILatest\Venkat.prt PT PRT
log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
java.lang.ClassCastException: net.sf.jasperreports.engine.design.JRDesignBand cannot be cast to net.sf.jasperreports.engine.design.JRDesignElement
at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2919)
at org.apache.commons.digester.Digester.createSAXExce ption(Digester.java:2945)
at org.apache.commons.digester.Digester.startElement( Digester.java:1364)
at org.apache.xerces.parsers.AbstractSAXParser.startE lement(Unknown Source)
at org.apache.xerces.parsers.AbstractXMLDocumentParse r.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digeste r.java:1647)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXM L(JRXmlLoader.java:238)
at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXM L(JRXmlLoader.java:225)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(J RXmlLoader.java:213)
at BeanToPdfCode.fill(BeanToPdfCode.java:82)
at MBenz.generateReport(MBenz.java:408)
at MBenz.access$0(MBenz.java:377)
at MBenz$3.actionPerformed(MBenz.java:215)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Error at line 262 char 58: net.sf.jasperreports.engine.design.JRDesignBand cannot be cast to net.sf.jasperreports.engine.design.JRDesignElement
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: The file: D:\MBRDI\MBRDILatest\Venkat.pdf doesn't exist.
at java.awt.Desktop.checkFileValidation(Unknown Source)
at java.awt.Desktop.open(Unknown Source)
at MBenz.openGeneratedReport(MBenz.java:432)
at MBenz.generateReport(MBenz.java:413)
at MBenz.access$0(MBenz.java:377)
at MBenz$3.actionPerformed(MBenz.java:215)
at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectio nPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Re: Cannot Get .jrxml Template report from jar file in java application
Quote:
java.lang.IllegalArgumentException: The file: D:\MBRDI\MBRDILatest\Venkat.pdf doesn't exist.
at java.awt.Desktop.checkFileValidation(Unknown Source)
at java.awt.Desktop.open(Unknown Source)
at MBenz.openGeneratedReport(MBenz.java:432)
Here is one thing to check.