Error while viewing generated PDF

I’m using a widget that was made available on the Bonita Community community site to view a PDF generated by my process. When I execute local my process the PDF is displayed to me correctly, however when I run in the engine where the processes stay I get internal server error. Does anyone view PDF files generated by your process and if so, how do they accomplish this?

The link from where I downloaded the custom widget was:
https://community.bonitasoft.com/project/pdf-viewer-widget1

Hello - an internal server error means that you should find more information about the failure in the server logs. Could you check if there is related information that could help with this investigation?

From your Engine log file I see two issues:

  • You have a custom page that is corrupted. Maybe you deploy a corrupted zip file for a custom page. I would recommend to try to delete it and deploy it again after trying to open the zip file to make sure the content is readable.
  • The second error message in the log is actually related to your issue with the document. The message “Error while retrieving the document with ID 27313 from the engine with root cause
    org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException”. The question I cannot really answer is why you get the id to a document that does not seems to be existing. Maybe it is related with the code of the custom widget that do an incorrect logic when working with Bonita API or maybe an incorrect state of data in the database related to document management.

Thanks for your response, I looked the server logs but could not figure out what could be causing the error.

2018-09-05 08:34:32.707 -0300 WARNING: org.bonitasoft.console.common.server.page.PageServlet Error while trying to display a page or resource for key process/Orçar serviços e peças/1.0 java.io.EOFException: Unexpected end of ZLIB input stream at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240) at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) at java.util.zip.ZipInputStream.read(ZipInputStream.java:194) at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:140) at org.bonitasoft.engine.io.IOUtil.extractZipEntries(IOUtil.java:387) at org.bonitasoft.engine.io.IOUtil.unzipToFolder(IOUtil.java:366) at org.bonitasoft.console.common.server.utils.UnzipUtil.unzip(UnzipUtil.java:44) at org.bonitasoft.console.common.server.utils.UnzipUtil.unzip(UnzipUtil.java:58) at org.bonitasoft.console.common.server.utils.UnzipUtil.unzip(UnzipUtil.java:65) at org.bonitasoft.console.common.server.page.CustomPageService.retrievePageZipContent(CustomPageService.java:262) at org.bonitasoft.console.common.server.page.CustomPageService.ensurePageFolderIsUpToDate(CustomPageService.java:110) at org.bonitasoft.console.common.server.page.PageRenderer.displayCustomPage(PageRenderer.java:75) at org.bonitasoft.console.common.server.page.PageRenderer.displayCustomPage(PageRenderer.java:65) at org.bonitasoft.console.common.server.page.PageServlet.displayPageOrResource(PageServlet.java:223) at org.bonitasoft.console.common.server.page.PageServlet.resolveAndDisplayPage(PageServlet.java:195) at org.bonitasoft.console.common.server.page.PageServlet.doGet(PageServlet.java:110) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at org.bonitasoft.console.common.server.page.PageServlet.service(PageServlet.java:91) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 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.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.isAuthorized(AuthenticationFilter.java:148) at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doAuthenticationFiltering(AuthenticationFilter.java:131) at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:118) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.bonitasoft.console.common.server.login.filter.AbstractAuthorizationFilter.doFilter(AbstractAuthorizationFilter.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:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

2018-09-05 08:35:07.156 -0300 SEVERE: org.bonitasoft.forms.server.DocumentImageServlet Error while retrieving the document with ID 27313 from the engine.
org.bonitasoft.engine.bpm.document.ArchivedDocumentNotFoundException: USERNAME=romualdo.santos | org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException:
at org.bonitasoft.engine.api.impl.DocumentAPIImpl.getArchivedVersionOfProcessDocument(DocumentAPIImpl.java:373)
at org.bonitasoft.engine.api.impl.ProcessAPIImpl.getArchivedVersionOfProcessDocument(ProcessAPIImpl.java:4736)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:462)
at org.bonitasoft.engine.api.impl.ServerAPIImpl$2.call(ServerAPIImpl.java:431)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:438)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:272)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:124)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:86)
at com.sun.proxy.$Proxy74.getArchivedVersionOfProcessDocument(Unknown Source)
at org.bonitasoft.forms.server.DocumentImageServlet.doGet(DocumentImageServlet.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
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.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.isAuthorized(AuthenticationFilter.java:148)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doAuthenticationFiltering(AuthenticationFilter.java:131)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
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:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException:
at org.bonitasoft.engine.core.document.api.impl.DocumentServiceImpl.getArchivedVersionOfProcessDocument(DocumentServiceImpl.java:209)
at org.bonitasoft.engine.api.impl.DocumentAPIImpl.getArchivedVersionOfProcessDocument(DocumentAPIImpl.java:371)
… 49 more

2018-09-05 08:35:07.159 -0300 SEVERE: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bonita].[formsDocumentImage] Servlet.service() for servlet [formsDocumentImage] in context with path [/bonita] threw exception [Error while retrieving the document with ID 27313 from the engine.] with root cause
org.bonitasoft.engine.commons.exceptions.SObjectNotFoundException:
at org.bonitasoft.engine.core.document.api.impl.DocumentServiceImpl.getArchivedVersionOfProcessDocument(DocumentServiceImpl.java:209)
at org.bonitasoft.engine.api.impl.DocumentAPIImpl.getArchivedVersionOfProcessDocument(DocumentAPIImpl.java:371)
at org.bonitasoft.engine.api.impl.ProcessAPIImpl.getArchivedVersionOfProcessDocument(ProcessAPIImpl.java:4736)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:462)
at org.bonitasoft.engine.api.impl.ServerAPIImpl$2.call(ServerAPIImpl.java:431)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:438)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:272)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:124)
at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:86)
at com.sun.proxy.$Proxy74.getArchivedVersionOfProcessDocument(Unknown Source)
at org.bonitasoft.forms.server.DocumentImageServlet.doGet(DocumentImageServlet.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
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.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.isAuthorized(AuthenticationFilter.java:148)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doAuthenticationFiltering(AuthenticationFilter.java:131)
at org.bonitasoft.console.common.server.login.filter.AuthenticationFilter.doFilter(AuthenticationFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.bonitasoft.console.common.server.login.filter.NoCacheFilter.doFilter(NoCacheFilter.java:53)
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:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

I will carry out the implementation test of the zip file of the custom widget again, and referring to the error of retrieving the ID of the generated document is that the strangest thing is that in the development environment (Windows) everything works normally but when I put the process in the production environment (Linux) this error occurs.