简体   繁体   English

XLConnect 错误:NoClassDefFoundError (Java):org/apache/poi/openxml4j/exceptions/InvalidFormatException

[英]XLConnect Error: NoClassDefFoundError (Java): org/apache/poi/openxml4j/exceptions/InvalidFormatException

I want to use XLConnect package, however, I am facing unexpected issues.我想使用 XLConnect package,但是,我遇到了意想不到的问题。

library(XLConnect)
wb <- XLConnect::loadWorkbook("file.xlsx")
Error: NoClassDefFoundError (Java): org/apache/poi/openxml4j/exceptions/InvalidFormatException

Does anyone know what is happening?有谁知道发生了什么?

There two possible causes to this issue that I know of:我知道这个问题有两个可能的原因:

Java dependency conflict Java 依赖冲突

If you have installed a package that also relies on Apache POI, such as xlsx , incorrect classes will be loaded.如果您安装了 package 也依赖于 Apache POI,例如xlsx ,将加载不正确的类。 If you restart your R session and avoid loading the conflicting package, this issue should be avoided.如果您重新启动 R session 并避免加载冲突的 package,则应避免此问题。

Failed download of java dependencies java 依赖项下载失败

Once you have installed XLConnect (using version 1.0.4 currently on CRAN), check that the java directory under the package's installation[0] contains the following:一旦您安装了 XLConnect(使用 CRAN 上当前的 1.0.4 版),请检查软件包安装 [0] 下的 java 目录是否包含以下内容:

ls /your/library/path/XLConnect/java/
commons-codec-1.15.jar    commons-compress.jar  curvesapi-1.06.jar  poi.jar        poi-ooxml-schemas.jar  XLConnect-1.0.3.jar
commons-collections4.jar  commons-math3.jar     ooxml-schemas.jar   poi-ooxml.jar  SparseBitSet.jar       xmlbeans.jar

If one of these is missing, remove the package, restart your R session, and reinstall the package. If one of these is missing, remove the package, restart your R session, and reinstall the package. Check for any errors that occur in that last step.检查最后一步中发生的任何错误。

[0] to find your library path, run .libPaths() in your R session. [0] 要查找您的库路径,请在 R session 中运行.libPaths()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用JXLS的org / apache / poi / openxml4j / exceptions / InvalidFormatException - org/apache/poi/openxml4j/exceptions/InvalidFormatException using JXLS 我收到错误::无法解决org.apache.poi.openxml4j.exceptions.InvalidFormatException - I am getting an error :: org.apache.poi.openxml4j.exceptions.InvalidFormatException cannot be resolved org.apache.poi.POIXMLException:org.apache.poi.openxml4j.exceptions.InvalidFormatException: - org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: 使用Apache POI读取xlsx文件时出现异常(org.apache.poi.openxml4j.exceptions.InvalidFormatException:日期格式不正确,…)? - Exception(org.apache.poi.openxml4j.exceptions.InvalidFormatException: Date not well formated, …) when reading xlsx file using Apache POI? Java InputStreamReader 错误 (org.apache.poi.openxml4j.exceptions.InvalidOperationException) - Java InputStreamReader Error (org.apache.poi.openxml4j.exceptions.InvalidOperationException) org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException - 编写 docx 时出错 - org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException - error to write docx Maven - org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException: - Maven - org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException: org.apache.poi.openxml4j.exceptions.InvalidOperationException:无法打开指定的文件: - org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: 错误:NoSuchMethodError(Java):org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource。 <init> (Ljava / util / zip / ZipInputStream;)V - Error: NoSuchMethodError (Java): org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.<init>(Ljava/util/zip/ZipInputStream;)V NoClassDefFoundError:java中的org / apache / poi / ss / formula / udf / UDFFinder错误 - NoClassDefFoundError: org/apache/poi/ss/formula/udf/UDFFinder error in java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM