加载XSSFWorkbook类的Apache POI错误 [英] Apache POI error loading XSSFWorkbook class

查看:533
本文介绍了加载XSSFWorkbook类的Apache POI错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个与Excel文档一起使用的程序,但HSSF格式对于我的要求来说太小了。我正在尝试转移到XSSF,但是在尝试使用它时我一直都会遇到错误。

I'm trying to write a program that works with Excel docs, but the HSSF format is too small for my requirements. I'm attempting to move to XSSF, but I keep getting errors when trying to use it.

我设法通过添加xmlbeans-2.3.0来解决前两个问题。 jar和dom4j-1.6.jar到我的程序,但现在出现这个错误,似乎没有通过添加Apache网站上提供的Apache commons jar来解决。

I managed to solve the first two by adding xmlbeans-2.3.0.jar and dom4j-1.6.jar to my program, but now this error is coming up, which doesn't seem to be resolved by adding the Apache commons jar available on the Apache website.

错误如下:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections4/ListValuedMap
    at hot.memes.ExcelCreator.main(ExcelCreator.java:66)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections4.ListValuedMap
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 1 more


解决方案

在构建路径中添加commons-collections4-x.x.jar文件并再次尝试。
它会起作用。

Add commons-collections4-x.x.jar file in your build path and try it again. It will work.

你可以从 https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.0

这篇关于加载XSSFWorkbook类的Apache POI错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆