Neither GenericXmlContextLoader nor AnnotationConfigContextLoader was able to load an ApplicationCon

Neither GenericXmlContextLoader nor AnnotationConfigContextLoader was able to load an ApplicationContext from [MergedContextConfiguration@6325a3ee testClass = jdbcTemplateTest, locations = ‘{}’, classes = ‘{}’, contextInitializerClasses = ‘[]’, activeProfiles = ‘{}’, propertySourceLocations = ‘{}’, propertySourceProperties = ‘{}’, contextCustomizers = set[[empty]], contextLoader = ‘org.springframework.test.context.support.DelegatingSmartContextLoader’, parent = [null]].

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
问题: Your InputStream was neither an OLE2 stream, nor an OOXM 回答: 这个错误通常是由于使用了错误的输入流类型导致的。根据引用\[1\]和引用\[2\]的信息,你可能在读取Excel文件时使用了错误的输入流类型。在你的代码中,你使用了FileInputStream来创建输入流,但实际上应该使用POIFSFileSystem或POIXMLDocument来创建输入流,具体取决于你要读取的Excel文件的格式。如果你的Excel文件是旧的二进制格式(.xls),你应该使用POIFSFileSystem来创建输入流。如果你的Excel文件是基于XML的格式(.xlsx),你应该使用POIXMLDocument来创建输入流。 另外,根据引用\[3\]的信息,你可能还需要检查你的依赖版本是否正确。确保你使用的是与你的Spring Boot版本和POI版本兼容的Hutool和POI依赖。 综上所述,要解决这个问题,你可以尝试以下几个步骤: 1. 检查你的Excel文件的格式,确定是旧的二进制格式还是基于XML的格式。 2. 根据Excel文件的格式选择正确的输入流类型,使用POIFSFileSystem或POIXMLDocument来创建输入流。 3. 检查你的依赖版本,确保与你的Spring Boot版本和POI版本兼容。 希望这些信息对你有帮助! #### 引用[.reference_title] - *1* [poi读取excel报错Your InputStream was neither an OLE2 stream, nor an OOXML stream](https://blog.csdn.net/qq_45068582/article/details/124840290)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [java poi读取excel报错Your InputStream was neither an OLE2 stream, nor an OOXML stream](https://blog.csdn.net/qq_25073261/article/details/124107443)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [POI读取Excel报错:Your InputStream was neither an OLE2 stream, nor an OOXM](https://blog.csdn.net/pimyker/article/details/128510681)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值