-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org.xml.sax.SAXNotRecognizedException 能帮我看看这是什么原因导致的吗?折腾了3天了,再不行弃坑了 #2054
Comments
遇到同样的问题,原因是http://apache.org/xml/features/disallow-doctype-decl 这个链接404了,这个feature是用来设置禁用DTD的,即不允许将外部实体包含在传入的 XML 文档中,从而防止XML实体注入。 但是,很遗憾,我也不知道该怎么fix 😭 |
Android端要跑起来真难啊 |
我也有遇到这个问题。
推测是xml解析器加载错了。具体未深究
|
有人解决吗? |
我也遇到了这个问题,解决不了打算用POI试试,在群里请教了一下大佬说POI也有坑,因为Java和安卓的一个基础类实现方式不一样。 |
大佬,我也遇到一样的了,之前跑着没问题,今天一看报这个错了 |
解决了吗 |
@lichuanjun @gotoorder @AlexJialene @VamChao @zhuangjiaju 克隆了一份代码,将这个feature异常包了起来 try {
saxFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
} catch (SAXNotRecognizedException e) {
log.warn(
"SAXNotRecognizedException occur, not supported feature: " +
"http://apache.org/xml/features/disallow-doctype-decl, which will disable DOCTYPE declaration" +
" if set true.");
} 在Android项目里以jar包形式引入自己编译的easyexcel包,在gradle文件里面引入以下依赖:
以上在 上面代码的fork地址:https://github.com/xworks/easyexcel |
大佬,为啥你把你的代码拷下来还是用不了呢,报com.alibaba.excel.exception.ExcelGenerateException: java.lang.ExceptionInInitializerError这个错 |
大佬,确实有效 跑着没问题吗? |
异常代码
1.MainActivity.java核心代码截图:
上述的path测试过,没有问题.demo.xlsx是存在手机上的测试文件,内容与easyexcel库中的demo.xlsx一致.
2.上述的DemoData和DemoDataListener也是与库demo中内容一致.
报错内容
项目依赖
The text was updated successfully, but these errors were encountered: