我正在使用alfresco community 5.0.d,当我尝试下载pdf报告时,我收到“无法加载PDF文档”。
同样在控制台中,没有错误。
以下是下载报告选项的屏幕截图。
我如何解决这个pdf加载问题? 另外暂时我想删除pdf的下载选项?如何实现这一目标呢?
更新:
catalina.out日志显示如下错误。
2017-02-08 17:29:20,375 ERROR [report.client.AbstractBeCPGReportClient] [http-bio-8080-exec-8] Error accessing report server timeStamp is null
2017-02-08 17:30:12,048 ERROR [report.client.AbstractBeCPGReportClient] [http-bio-8080-exec-1] Unable to parse response
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:601)
at java.lang.Long.parseLong(Long.java:631)
at fr.becpg.report.client.AbstractBeCPGReportClient.getTemplateTimeStamp(AbstractBeCPGReportClient.java:85)
at fr.becpg.repo.report.engine.impl.BeCPGReportServerClient.sendTplFile(BeCPGReportServerClient.java:136)
at fr.becpg.repo.report.engine.impl.BeCPGReportServerClient.access$000(BeCPGReportServerClient.java:49)
at fr.becpg.repo.report.engine.impl.BeCPGReportServerClient$1.doInReportSession(BeCPGReportServerClient.java:88)
at fr.becpg.report.client.AbstractBeCPGReportClient.executeInSession(AbstractBeCPGReportClient.java:181)
at fr.becpg.repo.report.engine.impl.BeCPGReportServerClient.createReport(BeCPGReportServerClient.java:79)
at fr.becpg.repo.report.search.impl.ReportServerSearchRenderer.renderReport(ReportServerSearchRenderer.java:128)
at fr.becpg.repo.report.search.impl.ExportSearchServiceImpl.createReport(ExportSearchServiceImpl.java:42)
at fr.becpg.repo.web.scripts.report.ExportSearchWebScript.execute(ExportSearchWebScript.java:97)
at org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:482)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:551)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:619)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScriptInternal(RepositoryContainer.java:399)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:280)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
2017-02-08 17:30:12,048 ERROR [report.client.AbstractBeCPGReportClient] [http-bio-8080-exec-1] Error accessing report server timeStamp is null
更新:
感谢。
答案 0 :(得分:0)
@ nikhil84,我建议使用此代码生成pdf再现,这样你就可以摆脱导致错误的库。
将PDFRenditionService添加到repoAmp / src / main / java / com / yourCompany / alfresco / service
public static final String PDFRENDITIONNAME =" pdfRendition&#34 ;; public static final QName pdfRenditionQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,PDFRENDITIONNAME); RenditionDefinition pdfRenditionDefinition = renditionService.createRenditionDefinition(pdfRenditionQName,ReformatRenderingEngine.NAME); pdfRenditionDefinition.setParameterValue(AbstractRenderingEngine.PARAM_MIME_TYPE,MimetypeMap.MIMETYPE_PDF); renditionService.saveRenditionDefinition(pdfRenditionDefinition);
//在自己的事务中执行此行 renditionService.render(sourceNodeRef,pdfRenditionDefinition);
ChildAssociationRef renditionAssoc = renditionService.getRenditionByName(sourceNodeRef,pdfRenditionName); if(renditionAssoc == null)返回null return renditionAssoc.getChildRef()
在回购放大器中添加一个露天的webscript,它将调用PDFRenditionService