当前位置: 代码迷 >> 综合 >> 解决:java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject报错问题
  详细解决方案

解决:java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject报错问题

热度:53   发布时间:2024-02-05 19:06:16.0

使用POI操作Excel,一直报如下错误:java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlObject
原因:之前项目导包的时候缺少了xmlbeans-2.6.0.jar包,加上之后就可以了。在这里插入图片描述
或者:使用如下jar包也可以,懒人直接点这里下载
在这里插入图片描述
奉上pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>cn.gok</groupId><artifactId>excelUtil</artifactId><version>0.0.1-SNAPSHOT</version><dependencies><!-- 导出excel --><dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>3.14</version></dependency><!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>3.14</version></dependency><!-- https://mvnrepository.com/artifact/org.apache.poi/poi-contrib --><dependency><groupId>org.apache.poi</groupId><artifactId>poi-contrib</artifactId><version>3.6</version></dependency><!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml-schemas --><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml-schemas</artifactId><version>3.17</version></dependency><!-- https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad --><dependency><groupId>org.apache.poi</groupId><artifactId>poi-scratchpad</artifactId><version>3.17</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.12</version></dependency></dependencies><build><plugins><plugin><artifactId>maven-compiler-plugin</artifactId><configuration><source>1.8</source><target>1.8</target></configuration></plugin></plugins></build>
</project>
  相关解决方案