Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Cannot Get .jrxml Template report from jar file in java application

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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...


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default 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.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cannot Get .jrxml Template report from jar file in java application

    Quote Originally Posted by Norm View Post
    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)

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Cannot Get .jrxml Template report from jar file in java application

    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.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. create jar file of jsp application
    By raghavan in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 27th, 2012, 08:13 AM
  2. java component to generate the report file in post script format
    By siva.wins in forum Java Theory & Questions
    Replies: 4
    Last Post: November 23rd, 2012, 03:04 AM
  3. Accessing BIRT report from java Application
    By shalome in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: April 2nd, 2012, 11:43 AM
  4. access denied (java.io.FilePermission "report.jrxml" read)
    By banny7 in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: November 3rd, 2011, 06:02 AM
  5. Saving .jsp page as .pdf file while generating report for struts based web application
    By ravindra_kumar_tiwari in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: August 12th, 2008, 09:32 AM