java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
java.lang.NoClassDefFoundError:org/apache/poi/hssf/usermodel/HSSFWorkbook
这是java网络项目。 java项目没问题,但是在web项目中,我遇到了这个异常。
Caused by: java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
Maven依赖:
<!-- apahce poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.7</version>
</dependency>
java.lang.NoClassDefFoundError:org/apache/poi/hssf/usermodel/HSSFWorkbook
This is java web project. The java project is ok, but in web, I got this exception.
Caused by: java.lang.ClassNotFoundException: org.apache.poi.hssf.usermodel.HSSFWorkbook
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
maven dependency :
<!-- apahce poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.7</version>
</dependency>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要将 Apache POI 文件放在服务器上的 WEB-INF/lib 文件夹中。
You need to put the Apache POI files in the WEB-INF/lib folder on the server.
检查
.m2
目录并尝试查找类HSSFWorkbook
如果存在此类,请检查 Web 应用程序的 lib 文件夹并尝试查找相同的类。Check
.m2
directory and try to find classHSSFWorkbook
if this class is present, check lib folder of your web app and try to find the same.