Free Support Forum - aspose.com

Word转pdf异常

[ERROR]20-07-24 11:23:08 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:253) - Servlet.service() for servlet action threw exception
java.lang.UnsatisfiedLinkError: com.aspose.words.shaping.harfbuzz.HB.hb_font_create(Ljava/lang/String;I)J
at com.aspose.words.shaping.harfbuzz.HB.hb_font_create(Native Method)
at com.aspose.words.shaping.harfbuzz.zzY.zzU(Unknown Source)
at com.aspose.words.shaping.harfbuzz.zzR.(Unknown Source)
at com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getTextShaper(Unknown Source)
at com.aspose.words.BasicTextShaperCache.getTextShaper(Unknown Source)
at com.aspose.words.zzYUU.zzZ(Unknown Source)
at com.aspose.words.zzYUW.zzZH(Unknown Source)
at com.aspose.words.zzYUW.zzQ(Unknown Source)
at com.aspose.words.zzYUX.zzQ(Unknown Source)
at com.aspose.words.zzYT4.zzYxN(Unknown Source)
at com.aspose.words.zzYU6.zz8a(Unknown Source)
at com.aspose.words.zzYU6.zzYh(Unknown Source)
at com.aspose.words.zzYT4.zzYh(Unknown Source)
at com.aspose.words.zzZIX.zzzX(Unknown Source)
at com.aspose.words.zzZIX.zzW(Unknown Source)
at com.aspose.words.zzZIX.zzUx(Unknown Source)
at com.aspose.words.zzZIQ.zzZ(Unknown Source)
at com.aspose.words.zzZIQ.zzM(Unknown Source)
at com.aspose.words.zzZIZ.zzz(Unknown Source)
at com.aspose.words.zzZIZ.zzU(Unknown Source)
at com.aspose.words.zzZIZ.zzV(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzYUQ.zzYyy(Unknown Source)
at com.aspose.words.zzYUQ.zzY(Unknown Source)
at com.aspose.words.zzYUQ.zzZ(Unknown Source)
at com.aspose.words.zzZ3J.zzU(Unknown Source)
at com.aspose.words.zzZ3J.zzI(Unknown Source)
at com.aspose.words.zzYSR.zz9(Unknown Source)
at com.aspose.words.zzZWU.zzY(Unknown Source)
at com.aspose.words.zzZWU.zzX(Unknown Source)
at com.aspose.words.zzZWU.zzR(Unknown Source)
at com.aspose.words.zzZ47.zzL(Unknown Source)
at com.aspose.words.zzZ3J.zzI(Unknown Source)
at com.aspose.words.zzYSR.zz9(Unknown Source)
at com.aspose.words.zz8A.zzI(Unknown Source)
at com.aspose.words.zz8B.zzZDJ(Unknown Source)
at com.aspose.words.zzZ4C.zzYOb(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zz31.zzZxk(Unknown Source)
at com.aspose.words.zz32.zzF0(Unknown Source)
at com.aspose.words.zzZZU.zzXU(Unknown Source)
at com.aspose.words.zzZZU.zzZ(Unknown Source)
at com.aspose.words.zzZZU.zzYW(Unknown Source)
at com.aspose.words.Document.zzZEY(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at net.theol.projects.common.reportrepository.render.AsposeWordToPdfReportTemplate.renderReport(AsposeWordToPdfReportTemplate.java:139)
at net.theol.projects.common.reportrepository.render.AsposeWordToPdfReportTemplate.renderReport(AsposeWordToPdfReportTemplate.java:184)
at net.theol.projects.common.reportrepository.render.PdfReportRenderController.pdfReportRender(PdfReportRenderController.java:103)
at net.theol.projects.common.reportrepository.web.PdfRenderReportAction.actionPerformed(PdfRenderReportAction.java:80)
at net.theol.projects.common.strutsextend.TheolAction.execute(TheolAction.java:34)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at net.theol.projects.common.strutsextend.EncodeFilter.doFilter(EncodeFilter.java:36)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at net.theol.projects.common.strutsextend.EncodeFilter.doFilter(EncodeFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:662)
java.lang.UnsatisfiedLinkError: com.aspose.words.shaping.harfbuzz.HB.hb_font_create(Ljava/lang/String;I)J
at com.aspose.words.shaping.harfbuzz.HB.hb_font_create(Native Method)
at com.aspose.words.shaping.harfbuzz.zzY.zzU(Unknown Source)
at com.aspose.words.shaping.harfbuzz.zzR.(Unknown Source)
at com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getTextShaper(Unknown Source)
at com.aspose.words.BasicTextShaperCache.getTextShaper(Unknown Source)
at com.aspose.words.zzYUU.zzZ(Unknown Source)
at com.aspose.words.zzYUW.zzZH(Unknown Source)
at com.aspose.words.zzYUW.zzQ(Unknown Source)
at com.aspose.words.zzYUX.zzQ(Unknown Source)
at com.aspose.words.zzYT4.zzYxN(Unknown Source)
at com.aspose.words.zzYU6.zz8a(Unknown Source)
at com.aspose.words.zzYU6.zzYh(Unknown Source)
at com.aspose.words.zzYT4.zzYh(Unknown Source)
at com.aspose.words.zzZIX.zzzX(Unknown Source)
at com.aspose.words.zzZIX.zzW(Unknown Source)
at com.aspose.words.zzZIX.zzUx(Unknown Source)
at com.aspose.words.zzZIQ.zzZ(Unknown Source)
at com.aspose.words.zzZIQ.zzM(Unknown Source)
at com.aspose.words.zzZIZ.zzz(Unknown Source)
at com.aspose.words.zzZIZ.zzU(Unknown Source)
at com.aspose.words.zzZIZ.zzV(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzW0.zzZ(Unknown Source)
at com.aspose.words.zzYUQ.zzYyy(Unknown Source)
at com.aspose.words.zzYUQ.zzY(Unknown Source)
at com.aspose.words.zzYUQ.zzZ(Unknown Source)
at com.aspose.words.zzZ3J.zzU(Unknown Source)
at com.aspose.words.zzZ3J.zzI(Unknown Source)
at com.aspose.words.zzYSR.zz9(Unknown Source)
at com.aspose.words.zzZWU.zzY(Unknown Source)
at com.aspose.words.zzZWU.zzX(Unknown Source)
at com.aspose.words.zzZWU.zzR(Unknown Source)
at com.aspose.words.zzZ47.zzL(Unknown Source)
at com.aspose.words.zzZ3J.zzI(Unknown Source)
at com.aspose.words.zzYSR.zz9(Unknown Source)
at com.aspose.words.zz8A.zzI(Unknown Source)
at com.aspose.words.zz8B.zzZDJ(Unknown Source)
at com.aspose.words.zzZ4C.zzYOb(Unknown Source)
at com.aspose.words.Document.updatePageLayout(Unknown Source)
at com.aspose.words.zz31.zzZxk(Unknown Source)
at com.aspose.words.zz32.zzF0(Unknown Source)
at com.aspose.words.zzZZU.zzXU(Unknown Source)
at com.aspose.words.zzZZU.zzZ(Unknown Source)
at com.aspose.words.zzZZU.zzYW(Unknown Source)
at com.aspose.words.Document.zzZEY(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at net.theol.projects.common.reportrepository.render.AsposeWordToPdfReportTemplate.renderReport(AsposeWordToPdfReportTemplate.java:139)
at net.theol.projects.common.reportrepository.render.AsposeWordToPdfReportTemplate.renderReport(AsposeWordToPdfReportTemplate.java:184)
at net.theol.projects.common.reportrepository.render.PdfReportRenderController.pdfReportRender(PdfReportRenderController.java:103)
at net.theol.projects.common.reportrepository.web.PdfRenderReportAction.actionPerformed(PdfRenderReportAction.java:80)
at net.theol.projects.common.strutsextend.TheolAction.execute(TheolAction.java:34)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:217)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:108)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:191)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at net.theol.projects.common.strutsextend.EncodeFilter.doFilter(EncodeFilter.java:36)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at net.theol.projects.common.strutsextend.EncodeFilter.doFilter(EncodeFilter.java:36)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:662)

本地开发环境是好的 放到测试服务器上就出问题

图片.png (9.7 KB)
我还需要提供什么信息

请参考https://forum.aspose.com/t/doc-pdf/206589/11

我是在代码中加了这个处理方法 出现的问题
doc.getLayoutOptions().setTextShaperFactory(com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getInstance());

@beoned

为了确保及时准确的响应,请在此处附加以下资源进行测试:

  • 您输入的Word文档。
  • 请创建一个简单的Java应用程序(无编译错误的源代码),以帮助我们重现您的问题并将其附加在此处进行测试。

在您准备好这些信息之后,我们将开始对您的问题进行调查,并为您提供更多信息。 谢谢你的配合。

PS:要附加这些资源,请压缩并上传它们。

@tahir.manzoor
testAspose.zip (25.7 KB)

这是一个非maven普通java项目 需要你们自己添加jar包 注意 非web项目 无需tomcat 即可复现问题 doc测试文件在 src/main/resources 下

图片.png (2.9 KB)

windows开发环境 可以正常转换
linux生产环境会报错

图片.png (9.0 KB)

linux版本信息:
Linux version 2.6.9-78.ELsmp (brewbuilder@ls20-bc2-14.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Wed Jul 9 15:46:26 EDT 2008

生产其他环境
jdk1.6.0_45
Tomcat Version 5.5.36

@beoned

感谢您分享细节。 我们正在调查此问题,并将尽快与您联系。

@beoned

我们已经使用最新版本的Aspose.Words for Java 20.7测试了该方案,但未发现共享问题。 因此,请使用Aspose.Words for Java 20.7

我的许可证只到20.6 你能试试20.6吗

请问你是在我给的环境下测试的吗 我试过20.7 还是不行 windows没问题 linux服务器报错
java.lang.UnsatisfiedLinkError: com.aspose.words.shaping.harfbuzz.HB.hb_font_create_from_data([BI)J

报的这个错和上面的错有些许区别 请问这是字体的错误码

@beoned

是的,我们使用简单的Java应用程序和带有Tomcat 7的Web应用程序在具有Java 6的Linux操作系统上测试了该方案。有关详细信息,请参见随附的图像。

请确保您使用的是此论坛主题中共享的同一文档。 您能否分享以下详细信息以进行进一步测试?

  • 您使用的是64位JDK还是32位?
  • 请在不使用以下代码行的情况下测试情况
  • doc.getLayoutOptions()。setTextShaperFactory(com.aspose.words.shaping.harfbuzz.HarfBuzzTextShaperFactory.getInstance());
  • 请确保您已安装文档中使用的所有字体。
  • 请检查是否仅使用Tomcat 5.5.36遇到此问题

1 64位jdk
2 不使用这个代码 当然就可以 因为就是这行代码报的错
3 在任意新文档 输入最简单的一个数字 使用宋体( 所有系统都初始化的字体) 就会出错
4 tomcat5 tomcat6都有问题 tomcat7没试 因为没法往上升级

@beoned

请给我们一点时间。 我们将设置tomcat 5或tomcat 6并测试这种情况。 我们将尽快与您联系。

@beoned

您能否分享完整的异常详细信息(堆栈跟踪)?
另请压缩并附加您在Tomcat中使用的WAR文件。 谢谢你的配合。

https://pan.baidu.com/s/1UWTXb3pLvT2IdOS-7nY7MA 提取码: 7mb7
war包在这个百度网盘 要是无法获得你可以给我留个邮箱

error.zip (1.5 KB)

@beoned

很遗憾,我们无法下载WAR文件。 请在其他免费文件托管服务中共享它,并共享下载链接。 谢谢你的配合。

这就是一个免费的网盘啊 我没有其他的文件托管服务了 你能否给我一个邮箱 我给你发邮件

@beoned

您能使用Dropbox并在那里上传文件吗?

我们已经使用Tomcat 6再次测试了该方案,但没有发现此问题。 请ZIP并上传您正在使用的tomcat服务器。 我们将使用相同的tomcat服务器进行测试。


看看行不行

JDK版本是1.6.0_45