word导入的问题
HTTP Status 500 – Internal Server Error
Type Exception Report
Message org.apache.xmlbeans.XmlException: Element workbook@http://schemas.openxmlformats.org/spreadsheetml/2006/main is not a valid document@http://schemas.openxmlformats.org/wordprocessingml/2006/main document or a valid substitution.
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.poi.POIXMLException: org.apache.xmlbeans.XmlException: Element workbook@http://schemas.openxmlformats.org/spreadsheetml/2006/main is not a valid document@http://schemas.openxmlformats.org/wordprocessingml/2006/main document or a valid substitution.
org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:229)
org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:190)
org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:119)
org.imooc.service.WordService.imp(WordService.java:27)
org.imooc.servlet.ImportWordServlet.doGet(ImportWordServlet.java:31)
org.imooc.servlet.ImportWordServlet.doPost(ImportWordServlet.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause
org.apache.xmlbeans.XmlException: Element workbook@http://schemas.openxmlformats.org/spreadsheetml/2006/main is not a valid document@http://schemas.openxmlformats.org/wordprocessingml/2006/main document or a valid substitution.
org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:329)
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1391)
org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1370)
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:370)
org.apache.poi.POIXMLTypeLoader.parse(POIXMLTypeLoader.java:144)
org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown Source)
org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:152)
org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:190)
org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:119)
org.imooc.service.WordService.imp(WordService.java:27)
org.imooc.servlet.ImportWordServlet.doGet(ImportWordServlet.java:31)
org.imooc.servlet.ImportWordServlet.doPost(ImportWordServlet.java:21)
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Note The full stack trace of the root cause is available in the server logs.
Apache Tomcat/8.5.43
以上是当导入选07版Excel文件时出现的错误,导入txt、03版Excel都能弹出msg的提示信息。异常处理包含Exception的代码块,不知道什么问题。
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 1088 份
- 解答问题 10205 个
如果你有Java语言基础,又想以后从事Java Web开发,那么本路径是你的不二选择!本路径从网页搭建开始入手,通过大量案例来学习Java Web基础。定能助你完成Java Web小白的蜕变!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星