freemaker生成doc文档(特殊字符导致异常)

背景:freemaker生成doc文档转PDF,PDF文档为0kb(表象)。之前的代码生成doc文档转为PDF后,删除doc文档,且异常处理的时候并未输出异常日志。导致生产问题一直定位不到原因,观察了好久。后来重新调整代码,优化异常处理,不删除doc文件,才定位到问题原因。
异常日志如下:

2020-03-27 09:50:42,316 [ERROR] [default task-44] c.c.m.modular.corpacct.service.impl.GenApplyFromServiceImpl [GenApplyFromServiceImpl.java : 1527] 表单出错:The document appears to be corrupted and cannot be loaded.
com.aspose.words.FileCorruptedException: The document appears to be corrupted and cannot be loaded.
	at com.aspose.words.FileFormatUtil.zzZ(Unknown Source)
	at com.aspose.words.Document.zzY(Unknown Source)
	at com.aspose.words.Document.zzZ(Unknown Source)
	at com.aspose.words.Document.<init>(Unknown Source)
	at com.aspose.words.Document.<init>(Unknown Source)
	at com.csii.mbdss.modular.corpacct.service.impl.GenApplyFromServiceImpl.doc2pdf(GenApplyFromServiceImpl.java:1524)
	at com.csii.mbdss.modular.corpacct.service.impl.GenApplyFromServiceImpl.process(GenApplyFromServiceImpl.java:1469)
	at com.csii.mbdss.modular.corpacct.service.impl.GenApplyFromServiceImpl.genBalanceAcctApplyForm(GenApplyFromServiceImpl.java:235)
	at com.csii.mbdss.modular.corpacct.service.impl.GenApplyFromServiceImpl$$FastClassBySpringCGLIB$$4a604cb5.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
	at com.csii.mbdss.modular.corpacct.service.impl.GenApplyFromServiceImpl$$EnhancerBySpringCGLIB$$11b91c51.genBalanceAcctApplyForm(<generated>)
	at com.csii.mbdss.modular.corpacct.controller.BuildMailController.build3Docs(BuildMailController.java:153)
	at com.csii.mbdss.modular.corpacct.controller.BuildMailController.buildMailContent(BuildMailController.java:96)
	at com.csii.mbdss.modular.corpacct.controller.BuildMailController$$FastClassBySpringCGLIB$$d8d5f68c.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
	at com.csii.mbdss.core.intercept.SessionInterceptor.sessionKit(SessionInterceptor.java:31)
	at sun.reflect.G
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值