longdh101092 Posted July 2, 2019 Share Posted July 2, 2019 Hi Everybody!Sorry for my bad English :(I have a trouble with JasperFillManager.fillReport on Java 8 and CentOS 7.3.I want to create a PDF file with JasperReport 6.6.0 library. In windows 10, it's working normaly but when I upload my program to server (CentOS 7.3) it's doesn't work, I'm cheked server's log but this don't have any exeption or any bug. I use Japanese for text of PDF file.Here's environment of my program:・JAVA 8・TOMCAT 8.5・iText 5.5・Jasperreports 6.6I think may be problem is Centos 7.3 not have font for Japanese but it's wrong (I tried to fix it with blank PDF file and not work too). After that, I check authority of file.jasper and file.jrxml and it's ok. Finnally, I try to debug step by step and my code die from JasperFillManager.fillReport.Here's my code (sorry I can't show all of code):JasperReport report = JasperCompileManager.compileReport("path_of_jrxml_file.jrxml");JasperPrint jrpint_jpn = JasperFillManager.fillReport(report, parameter, new JREmptyDataSource());※parameter is Map<String, Object> and it have valuesCould you tell me what's my problem or some method to check cause or how to fix it on CentOS.I hope you understand me, and I'm sorry again for my English.Thanks. Link to comment Share on other sites More sharing options...
C-Box Posted July 2, 2019 Share Posted July 2, 2019 Are you sure, that iText 5.5 is working with JasperReports 6.6.0 ?? As far as I know, Jasper just uses the old (L)GPL library of iText 2.1.7 ... (e.g. in Studio also just "itext_2.1.7.js6_b02.jar" is included in classpath) as the later library version of itext was another - not free - licence type. Or do you own an iText licence for 5.5 ?So another try would be to change the log4j-level to TRACE hth + regardsC-Box Link to comment Share on other sites More sharing options...
longdh101092 Posted July 2, 2019 Author Share Posted July 2, 2019 C-Box Thank you for answer! I don't have iText licence for 5.5. So I will try to downgrade version of iText library to 2.1.7... and can I keep JasperReports 6.6.0 or downgrade it? Please, teach me!Thank you so much! Link to comment Share on other sites More sharing options...
C-Box Posted July 2, 2019 Share Posted July 2, 2019 You can stay at JasperReports 6.6.0 so no downgrade needed.... just use the itext-library that is included in JR-distribution (as they changed some stuff for their needs ... that's why the included jar-file has the suffix "js6_b02" in the filename). hth + regardsC-Box Link to comment Share on other sites More sharing options...
longdh101092 Posted July 3, 2019 Author Share Posted July 3, 2019 Hi C-BoxI tried to downgrade itext version to 2.1.7 and it's not work on CentOS but work on Windows. I don't know why but when I view it's log result of JasperFillManager.fillReport is null. Here's my code and log, can you help me?Code:JasperReport report = null;JasperPrint jrprint_jpn = null;try {report = JasperCompileManager.compileReport("path_of_jrxml_file.jrxml");this.logger.info("【jasperReport.getName()】" + report.getName());jrpint_jpn = JasperFillManager.fillReport(report, parameter, new JREmptyDataSource());this.logger.info("【JasperPrint.getName()】:" + jrpint_jpn.getName());} catch (JRExeption e){this.logger.info("JRExeption has error");this.logger.error(e);} finally {if (report == null) {this.logger.debug("JasperReport class not work!")}if (jrpint_jpn == null) {this.logger.debug("JasperPrint class not work!")}File fl = new File("file_path");if (!fl.exists()){this.logger.error("PDF file is not found!");return false;}this.logger.info("PDF file is found!");}Log on CentOS【jasperReport.getName()】Report01created delayed action 1 for filler 1Loading font extensions from font/font.xmlParsing font familu ipaexgLoading font font/ipaexg.ttfLoading font extensions from net/sf/jasperreports/fonts/fonts.xmlParsing font family DejaVu SansLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans-Bold.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans-Oblique.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans-BoldOblique.ttfParsing font family DejaVu SerifLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif-Bold.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif-Oblique.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif-BoldOblique.ttfParsing font family DejaVu Sans MonoLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono-Bold.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono-Oblique.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono-BoldOblique.ttfParsing font family SansSerifParsing font family SerifParsing font family MonospacedParsing font family JasperReports IconsLoading font net/sf/jasperreport/fonts/icons/icons.ttfParsing font family PictonicLoading font net/sf/jasperreport/fonts/icons/icons.ttfJasperPrint class not work!PDF file is found! Log on Windows【jasperReport.getName()】Report01created delayed action 1 for filler 1Loading font extensions from font/font.xmlParsing font familu ipaexgLoading font font/ipaexg.ttfLoading font extensions from net/sf/jasperreports/fonts/fonts.xmlParsing font family DejaVu SansLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans-Bold.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans-Oblique.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSans-BoldOblique.ttfParsing font family DejaVu SerifLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif-Bold.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif-Oblique.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSerif-BoldOblique.ttfParsing font family DejaVu Sans MonoLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono-Bold.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono-Oblique.ttfLoading font net/sf/jasperreport/fonts/dejavu/DejaVuSansMono-BoldOblique.ttfParsing font family SansSerifParsing font family SerifParsing font family MonospacedOrigin {reportName: null, groupName: null,bandType: TITLE} for band 1177750837Origin {reportName: null, groupName: null,bandType: DETAIL} for band 1340861289Filler 1 - pageHeight: 842, columnFooterOffsetY: 822, lastPageColumnFooterOffsetY: 822Fill 1: filling reportmax page width is 2097152000Fill 1: adding page 1Fill 1: title at 20......Fill 1: ended【JasperPrint.getName()】: Report01PDF file is found! Please, help me!Thanks and Regards Link to comment Share on other sites More sharing options...
C-Box Posted July 3, 2019 Share Posted July 3, 2019 Seems, as would cause the included Pictonic.ttf (that is included in default jasperreports-6.6.0.jar) that problem.I'm not familiar with CentOS, so I don't know, how the font-logic is working there. You could edit the jaspereports-fonts.xml in "jasperreports-6.6.0.jarnetsfjasperreportsfonts" and simply remove the entries for the Pictonic font. But not sure, if this is the correct solution.Also you could throw an eye on this page: https://vorozco.com/blog/2018/2018-03-14-Empty-Reports-Jasper-Reports.html or even this https://community.jaspersoft.com/questions/515250/solution-linux-pdf-font-problemPerhaps you will have to fix the Fonts at your CentOS as well before using JasperReports generally?!?!so sorry, no more glues from my side.hth + regardsC-Box Link to comment Share on other sites More sharing options...
longdh101092 Posted July 3, 2019 Author Share Posted July 3, 2019 Hi C-BoxThank for your Answer!I'm sory but one more time, I want to ask you. How to I edit the jaspereports-fonts.xml. In my project, I try to edit it but I can't beacause it's config of jasper report library.Thank and RegardsLongDH Link to comment Share on other sites More sharing options...
C-Box Posted July 3, 2019 Share Posted July 3, 2019 Well, this was just a try.... I know that this is a "built-in" config... but anyway no problem.You can open the (orignal) "JasperReports-6.6.0.jar" of your classpath with any ZipProgram of your choice... (I use 7zip for that) and just navigate to the mentioned xml-file, open it with an editor of your choice, change it (e.g. remove the lines pointing to the icon font) and save the (temporarily extracted) xml... 7zip just ask's you, to replace the (temporary) changed file also in the (jar)archive, just confirm it.Now you changed the "original" JasperReports-library.... but as this is just a try for tracking down the font problem, it's no problem. You easily can revert it (make a Backup before or download it again) Don't forget to restart your app, as you changed the library in your classpath.regards againC-Box 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