java.io.IOException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h2. Steps to reproduce # load a blank xlsx file # export it as a PDF like {code} File file = new File(currentFoler+ss.getBook().getBookName()+".pdf"); System.out.println(file.getAbsolutePath()); FileOutputStream fos = new FileOutputStream(file); //shall get exporter for each exporting Exporters.getExporter("pdf").export(ss.getBook(), fos); Filedownload.save(file, "application/excel"); {code} h3. Actual Result {quote} ExceptionConverter: java.io.IOException: The document has no pages. at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source) at com.lowagie.text.pdf.PdfWriter.close(Unknown Source) at com.lowagie.text.pdf.PdfDocument.close(Unknown Source) at com.lowagie.text.Document.close(Unknown Source) at org.zkoss.zss.model.impl.pdf.PdfExporter.export(PdfExporter.java:272) at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.BSHPrimarySuffix.doName(Unknown Source) at bsh.BSHPrimarySuffix.doSuffix(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHBlock.evalBlock(Unknown Source) at bsh.BSHBlock.eval(Unknown Source) at bsh.BshMethod.invokeImpl(Unknown Source) at bsh.BshMethod.invoke(Unknown Source) at bsh.BshMethod.invoke(Unknown Source) at bsh.Name.invokeLocalMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:133) at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:328) at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:900) {quote} h3. Expected result a friendly message "Spreadsheet find nothing to print" or just export one blank page.
    via by hawk,
  • h2. Steps to reproduce # load a blank xlsx file # export it as a PDF like {code} File file = new File(currentFoler+ss.getBook().getBookName()+".pdf"); System.out.println(file.getAbsolutePath()); FileOutputStream fos = new FileOutputStream(file); //shall get exporter for each exporting Exporters.getExporter("pdf").export(ss.getBook(), fos); Filedownload.save(file, "application/excel"); {code} h3. Actual Result {quote} ExceptionConverter: java.io.IOException: The document has no pages. at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source) at com.lowagie.text.pdf.PdfWriter.close(Unknown Source) at com.lowagie.text.pdf.PdfDocument.close(Unknown Source) at com.lowagie.text.Document.close(Unknown Source) at org.zkoss.zss.model.impl.pdf.PdfExporter.export(PdfExporter.java:272) at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.BSHPrimarySuffix.doName(Unknown Source) at bsh.BSHPrimarySuffix.doSuffix(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHBlock.evalBlock(Unknown Source) at bsh.BSHBlock.eval(Unknown Source) at bsh.BshMethod.invokeImpl(Unknown Source) at bsh.BshMethod.invoke(Unknown Source) at bsh.BshMethod.invoke(Unknown Source) at bsh.Name.invokeLocalMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:133) at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:328) at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:900) {quote} h3. Expected result a friendly message "Spreadsheet find nothing to print" or just export one blank page.
    via by hawk,
  • Tomcat and checked/unchecked exceptions
    via by Wendy S,
  • Document has no pages on Solaris, OK on Windows
    via by Unknown author,
  • h2. Steps to Reproduce # put the library property below in zk.xml {code} <library-property> <name>org.zkoss.zss.chart.title.font</name> <value>sansserif, bold, 30</value> </library-property> {code} # run zssapp # load demo_sample.xlsx # export to pdf h3. Actual Result *Exception thrown in 3.6* {code} ExceptionConverter: java.io.IOException: The document has no pages. at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source) at com.lowagie.text.pdf.PdfWriter.close(Unknown Source) at com.lowagie.text.pdf.PdfDocument.close(Unknown Source) at com.lowagie.text.Document.close(Unknown Source) at org.zkoss.zss.model.impl.pdf.PdfExporter.export(PdfExporter.java:263 ) at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49 ) at org.zkoss.zss.essential.ExportPdfComposer.doExport(ExportPdfComposer.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0( Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25 ) at java.lang.reflect.Method.invoke( Method.java:597) at org.zkoss.zk.ui.select.Selectors$ComposerEventListener.onEvent(Selectors.java:681) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2752 ) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2723 ) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2664 ) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136 ) at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1765 ) at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1550 ) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1260 ) at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:603 ) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:485 ) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:494 ) {code} *Exception thrown in 3.5* {code} java.lang.NullPointerException at org.zkoss.zssex.util.ZssChartExportEngine.drawJFreeChart(ZssChartExportEngine.java:99) at org.zkoss.zssex.util.ChartHelper.drawJFreeChart(ChartHelper.java:78) at org.zkoss.zss.model.impl.pdf.PdfExporter.layoutCharts(PdfExporter.java:999) at org.zkoss.zss.model.impl.pdf.PdfExporter.access$1500(PdfExporter.java:86) at org.zkoss.zss.model.impl.pdf.PdfExporter$PdfHeaderFooter.onEndPage(PdfExporter.java:1613) at com.lowagie.text.pdf.PdfDocument.newPage(Unknown Source) at com.lowagie.text.Document.newPage(Unknown Source) at org.zkoss.zss.model.impl.pdf.PdfExporter.printColumns(PdfExporter.java:581) at org.zkoss.zss.model.impl.pdf.PdfExporter.exportSheet(PdfExporter.java:302) at org.zkoss.zss.model.impl.pdf.PdfExporter.export(PdfExporter.java:182) at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49) at org.zkoss.zss.essential.ExportPdfComposer.doExport(ExportPdfComposer.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.zkoss.zk.ui.select.Selectors$ComposerEventListener.onEvent(Selectors.java:681) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2746) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2717) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2658) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1765) at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1550) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1260) at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:603) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:485) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:494) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) {code} h2. Debug Information From exception thrown in 3.5, I think root cause is in ZssChartExportEngine {code} final Font tfont = ChartHelper.getCustomFont(ChartHelper.TITLE_FONT_PROPERTY_KEY); if (tfont != null) { jfchart.getTitle().setFont(tfont); } {code} because chart title might be null.
    via by hawk,
  • need help
    via by 843836,
    • java.io.IOException: The document has no pages. at com.lowagie.text.pdf.PdfPages.writePageTree(Unknown Source) at com.lowagie.text.pdf.PdfWriter.close(Unknown Source) at com.lowagie.text.pdf.PdfDocument.close(Unknown Source) at com.lowagie.text.Document.close(Unknown Source) at org.zkoss.zss.model.impl.pdf.PdfExporter.export(PdfExporter.java:272) at org.zkoss.zss.api.impl.ExporterImpl.export(ExporterImpl.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at bsh.Reflect.invokeMethod(Unknown Source) at bsh.Reflect.invokeObjectMethod(Unknown Source) at bsh.BSHPrimarySuffix.doName(Unknown Source) at bsh.BSHPrimarySuffix.doSuffix(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHBlock.evalBlock(Unknown Source) at bsh.BSHBlock.eval(Unknown Source) at bsh.BshMethod.invokeImpl(Unknown Source) at bsh.BshMethod.invoke(Unknown Source) at bsh.BshMethod.invoke(Unknown Source) at bsh.Name.invokeLocalMethod(Unknown Source) at bsh.Name.invokeMethod(Unknown Source) at bsh.BSHMethodInvocation.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.BSHPrimaryExpression.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at bsh.Interpreter.eval(Unknown Source) at org.zkoss.zk.scripting.bsh.BSHInterpreter.exec(BSHInterpreter.java:133) at org.zkoss.zk.scripting.util.GenericInterpreter.interpret(GenericInterpreter.java:328) at org.zkoss.zk.ui.impl.PageImpl.interpret(PageImpl.java:900)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,