org.apache.poi.xssf.usermodel.XSSFSimpleShape cannot be cast to org.apache.poi.xssf.usermodel.XSSFPicture
时间: 2023-10-26 14:01:18 浏览: 408
这个报错是因为你在代码中把类型为XSSFSimpleShape的对象尝试强制转换为XSSFPicture类型,但是实际上这个转换是不可行的。这个错误的原因可能是你在使用hutool进行Excel文档导出时,没有正确导入org.apache.poi.xssf.usermodel.XSSFWorkbook这个类所在的包。如果你想要解决这个问题,你需要确保你的项目中已经引入了org.apache.poi JAR包,并且正确导入了需要使用的类,比如XSSFWorkbook。这个JAR包可以支持对office全系excel文件的解析。你可以参考导入的类的示例来导入其他需要的类,比如XSSFCell和XSSFRow等。这样就可以避免出现这个报错了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [java利用POI解析Excel及图片](https://blog.csdn.net/hgg923/article/details/89924022)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook错误](https://blog.csdn.net/tomatoarmys/article/details/123609544)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [org.apache.poi JAR包 Java](https://download.csdn.net/download/u014156358/9583484)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文