org.zkoss.poi.POIXMLException: org.apache.xmlbeans.XmlException: error: Unexpected element: XML_DOC_OR_TEXT_DECL

ZK-Tracker | paowang | 3 years ago
  1. 0

    reproducting steps: # load a empty xlsx file # insert a new sheet # export/save it # switch to this new sheet # input some text into any cell # export/save again #* this file can't load by ZSS and Excel error message on Excel: {noformat} Replaced Part: /xl/worksheets/sheet3.xml part with XML error. A text/xml declaration may occur only at the very beginning of input. Line 2, column 344. {noformat} stack trace on ZSS: {noformat} 2013-08-21 11:21:11.145:WARN::/ org.zkoss.poi.POIXMLException: org.apache.xmlbeans.XmlException: error: Unexpected element: XML_DOC_OR_TEXT_DECL at org.zkoss.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:199) at org.zkoss.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:189) at org.zkoss.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:355) at org.zkoss.poi.POIXMLDocument.load(POIXMLDocument.java:159) at org.zkoss.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:272) at org.zkoss.zss.model.sys.impl.XSSFBookImpl.<init>(XSSFBookImpl.java:101) at org.zkoss.zss.model.sys.impl.ExcelImporter.importsFromStream(ExcelImporter.java:107) at org.zkoss.zss.model.sys.impl.ExcelImporter.imports(ExcelImporter.java:73) at org.zkoss.zss.api.impl.ImporterImpl.imports(ImporterImpl.java:51) at org.zkoss.zss.api.impl.ImporterImpl.imports(ImporterImpl.java:71) at org.zkoss.zss.app.repository.impl.SimpleRepository.load(SimpleRepository.java:59) at org.zkoss.zss.app.ui.AppCtrl.doLoadBook(AppCtrl.java:308) at org.zkoss.zss.app.ui.AppCtrl.doAfterCompose(AppCtrl.java:182) at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:533) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:835) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:781) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:690) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:752) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:712) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:654) at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1035) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238) at org.zkoss.zul.Include.afterCompose(Include.java:450) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:833) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:781) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:690) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:752) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:712) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:654) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:397) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:312) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 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.servlet.Dispatcher.forward(Dispatcher.java:327) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:503) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 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.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 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) {noformat}

    ZK-Tracker | 3 years ago | paowang
    org.zkoss.poi.POIXMLException: org.apache.xmlbeans.XmlException: error: Unexpected element: XML_DOC_OR_TEXT_DECL
  2. 0

    reproducting steps: # load a empty xlsx file # insert a new sheet # export/save it # switch to this new sheet # input some text into any cell # export/save again #* this file can't load by ZSS and Excel error message on Excel: {noformat} Replaced Part: /xl/worksheets/sheet3.xml part with XML error. A text/xml declaration may occur only at the very beginning of input. Line 2, column 344. {noformat} stack trace on ZSS: {noformat} 2013-08-21 11:21:11.145:WARN::/ org.zkoss.poi.POIXMLException: org.apache.xmlbeans.XmlException: error: Unexpected element: XML_DOC_OR_TEXT_DECL at org.zkoss.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:199) at org.zkoss.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:189) at org.zkoss.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:355) at org.zkoss.poi.POIXMLDocument.load(POIXMLDocument.java:159) at org.zkoss.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:272) at org.zkoss.zss.model.sys.impl.XSSFBookImpl.<init>(XSSFBookImpl.java:101) at org.zkoss.zss.model.sys.impl.ExcelImporter.importsFromStream(ExcelImporter.java:107) at org.zkoss.zss.model.sys.impl.ExcelImporter.imports(ExcelImporter.java:73) at org.zkoss.zss.api.impl.ImporterImpl.imports(ImporterImpl.java:51) at org.zkoss.zss.api.impl.ImporterImpl.imports(ImporterImpl.java:71) at org.zkoss.zss.app.repository.impl.SimpleRepository.load(SimpleRepository.java:59) at org.zkoss.zss.app.ui.AppCtrl.doLoadBook(AppCtrl.java:308) at org.zkoss.zss.app.ui.AppCtrl.doAfterCompose(AppCtrl.java:182) at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:533) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:835) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:781) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:690) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:752) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:712) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:654) at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1035) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238) at org.zkoss.zul.Include.afterCompose(Include.java:450) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:833) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:781) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:690) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:752) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:712) at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:654) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:397) at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:312) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 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.servlet.Dispatcher.forward(Dispatcher.java:327) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126) at org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:503) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 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.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 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) {noformat}

    ZK-Tracker | 3 years ago | paowang
    org.zkoss.poi.POIXMLException: org.apache.xmlbeans.XmlException: error: Unexpected element: XML_DOC_OR_TEXT_DECL

    Root Cause Analysis

    1. org.zkoss.poi.POIXMLException

      org.apache.xmlbeans.XmlException: error: Unexpected element: XML_DOC_OR_TEXT_DECL

      at org.zkoss.poi.xssf.usermodel.XSSFSheet.read()
    2. org.zkoss.poi
      XSSFWorkbook.<init>
      1. org.zkoss.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:199)
      2. org.zkoss.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:189)
      3. org.zkoss.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:355)
      4. org.zkoss.poi.POIXMLDocument.load(POIXMLDocument.java:159)
      5. org.zkoss.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:272)
      5 frames
    3. org.zkoss.zss
      AppCtrl.doAfterCompose
      1. org.zkoss.zss.model.sys.impl.XSSFBookImpl.<init>(XSSFBookImpl.java:101)
      2. org.zkoss.zss.model.sys.impl.ExcelImporter.importsFromStream(ExcelImporter.java:107)
      3. org.zkoss.zss.model.sys.impl.ExcelImporter.imports(ExcelImporter.java:73)
      4. org.zkoss.zss.api.impl.ImporterImpl.imports(ImporterImpl.java:51)
      5. org.zkoss.zss.api.impl.ImporterImpl.imports(ImporterImpl.java:71)
      6. org.zkoss.zss.app.repository.impl.SimpleRepository.load(SimpleRepository.java:59)
      7. org.zkoss.zss.app.ui.AppCtrl.doLoadBook(AppCtrl.java:308)
      8. org.zkoss.zss.app.ui.AppCtrl.doAfterCompose(AppCtrl.java:182)
      8 frames
    4. ZK Kernel
      AbstractExecution.createComponents
      1. org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:533)
      2. org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:835)
      3. org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:781)
      4. org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:690)
      5. org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:752)
      6. org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:712)
      7. org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:654)
      8. org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1035)
      9. org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
      10. org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
      10 frames
    5. ZK XUL Components
      Include.afterCompose
      1. org.zkoss.zul.Include.afterCompose(Include.java:450)
      1 frame
    6. ZK Kernel
      DHtmlLayoutServlet.doGet
      1. org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:833)
      2. org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:781)
      3. org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:690)
      4. org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:752)
      5. org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:712)
      6. org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:654)
      7. org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:397)
      8. org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:312)
      9. org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215)
      10. org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136)
      10 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      2 frames
    8. Jetty Server
      DefaultServlet.doGet
      1. org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      2. org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      3. org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      4. org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      5. org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      6. org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      7. org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:327)
      8. org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
      9. org.mortbay.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:503)
      9 frames
    9. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      2 frames
    10. Jetty Server
      SelectChannelEndPoint.run
      1. org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      2. org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
      3. org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      4. org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      5. org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      6. org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
      7. org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      8. org.mortbay.jetty.Server.handle(Server.java:326)
      9. org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      10. org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
      11. org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
      12. org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
      13. org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      14. org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
      14 frames
    11. Jetty Util
      QueuedThreadPool$PoolThread.run
      1. org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      1 frame