was6.1发布的程序打印pdf报错:
1、was6.1.0.47版本,补丁包如下所示,打印pdf一直报错:数组角标越界,开发人员排查了很长时间无果,因为代码是在jdk1.4的环境中开发,was6.1默认jdk环境为1.5,所以怀疑是jdk版本的问题,后将jdk 047的补丁包卸载,打了017的补丁包解决了问题,为了防止出现其他bug,后又打了045的补丁包
SystemErr R com.icsc.dpms.dr.core.impl.drjcReportTemplateImpl:error:Array index out of range: 0
SystemErr R java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0
2、列印失败Font '宋体 is not available to thev. See the Javadoc for more details.
操作系统中已经安装了宋体但无效,参考https://community.jaspersoft.com/questions/531843/font-arial-not-available-jvm-see
将宋体simsun.ttf上传至was安装路径下/java/jre/lib/fonts/ 中,执行以下命令安装宋体,重启was问题解决
# mkfontscale
# mkfontdir
# fc-cache
3、Could not load the following font : pdfFontName : Courier pdfEncoding : UniGB-UCS2-H isPdfEmbedded : false
看到很多人说是因为没有iTextAsian.jar,但程序下的确有这个包,查看发现这个包里并没有我报错的字体Courier,因此将生成pdf的xml中的Courier替换成“宋体”,问题解决
修改前:
修改后: