从AEM DAM读取xlsx时获取java.lang.reflect.InvocationTargetException

从AEM DAM读取xlsx文件时出现以下异常,尽管它适用于xls java.lang.reflect.invocationTargetException

AEM depfinder中的依赖项是

<dependency>
    <artifactId>com.adobe.granite.poi</artifactId>
    <version>2.0.24</version>
    <groupId>com.adobe.granite</groupId>
    <scope>provided</scope>
</dependency>

Below is the code

                resourceResolver = request.getResourceResolver();
                String nodePath = "/content/dam/sample/SampleCsv.xlsx";
                Resource resource = resourceResolver.getResource(nodePath);
                if (resource != null) {
                asset = resource.adaptTo(Asset.class);
                if (asset != null) {
                original = asset.getOriginal();
                InputStream input = original.getStream();
                Workbook workbook= new XSSFWorkbook(input);
                log.info("workbook created");
                int sheetCount= workbook.getNumberOfSheets();
dosoo 回答:从AEM DAM读取xlsx时获取java.lang.reflect.InvocationTargetException

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3147593.html

大家都在问