ktrinad Posted August 31, 2006 Share Posted August 31, 2006 By: Zihong Lu - zihong running iReport in jar files 2003-12-07 23:20 Has anyone tried running iReport in jar files? I tried to jar iReports 0.2.2 (everything under classes), with the manifest shown here: Main-Class: it.businesslogic.ireport.gui.MainFrame Class-Path: commons-beanutils.jar commons-collections.jar commons-digest.jar commons-logging.jar commons-logging-api.jar itext-0.96.jar iTextAsian.jar jakarta-poi-1.5.1-final-20020615.jar jasperreports-0.5.0.jar jcommon-0.8.0.jar jconn2d.jar jfreechart-0.9.8.jar tools.jar xercesImpl.jar xmlParserAPIs.jar (Note: all the jar file names are on the same line as the Class-Path:, separated by space). Once I got the iReport.jar file, I placed the iReport.jar in the same directory as those jar files, ie, in the lib directory. I could start the iReport, create new doc, open existing doc. However, I could not compile the new or old doc. Clicked the compile button showed "Compiling to file... C:testtest.jasper -> C:cvs_treeiReport2libtest.java" at the bottom. That is it. No other error message. Looking into the code looks like the line "JasperCompileManager.compileReportToFile()" in the IReportCompiler.java throws exception. I did have the jasperreports-0.5.0.jar in the lib direcotory. By the way, the iReport ran well using the iReport.bat come with the package, after modified the path. Any comment is highly appreciated. -Zihong By: Zihong Lu - zihong RE: running iReport in jar files 2003-12-09 22:35 A correction on my earlier post. The line JasperCompileManager.compileReportToFile() did not throw exception, it never returned. I have tried to replace the call with JasperDesign jasperDesign = JasperManager.loadXmlDesign(inputStream); JRBshCompiler theCompiler = new JRBshCompiler(); JasperReport result = theCompiler.compileReport(jasperDesign); and found out that the loadXmlDesign() never returned (The inputStream is not null, I checked it). -Zihong By: Zihong Lu - zihong RE: running iReport in jar files 2003-12-10 10:44 It turned out that the Classpath in my manifest mispelled the commons-digester.jar to commons-digest.jar. Anyway, after corrected it, this problem solved, even though the iReport.jar still does not work. When I start the iReport.jar with java -jar iReport.jar in the lib directory, iReport complained about package dori.jasper.engine does not exist import dori.jasper.engine.*; Somehow the system could not find the class path, even though they are specified in the manifest. Any suggestion? -Zihong 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