Menu

#445 java.lang.NoClassDefFoundError org/apache/commons/compress/utils/IOUtils

v2.7.*
open
nobody
None
(not fixed)
5
2022-05-13
2022-05-13
markiewb
No

When using a Spring Boot 2.x-application (without poi-ooxml-dependency) and importing an NCLOB-Datatype a NoClassDefFoundError is thrown

java.lang.NoClassDefFoundError org/apache/commons/compress/utils/IOUtils
at org.dbunit.ext.oracle.OracleClobDataType.getClob(OracleClobDataType.java:99)

This issue has been introduced by https://sourceforge.net/p/dbunit/code.git/ci/fd27b4e6bfd36265d6341bc55a927301a9669434/

There IOUtils.closeQuietly(..) is used, which comes from org.apache.commons:commons-compress, which is a transitive dependency of the org.apache.poi:poi-ooxml dependency:

$ mvn dependency:tree -Dverbose=true -Dincludes=org.apache.commons:commons-compress

[INFO] -------------------------< org.dbunit:dbunit >--------------------------
[INFO] Building dbUnit Extension 2.7.3
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ dbunit ---
[INFO] org.dbunit:dbunit:jar:2.7.3
[INFO] \- org.apache.poi:poi-ooxml:jar:4.1.0:compile
[INFO]    \- org.apache.commons:commons-compress:jar:1.18:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.934 s
[INFO] Finished at: 2022-05-13T11:33:42+02:00
[INFO] ------------------------------------------------------------------------

BUT poi-ooxml is marked as <optional>true</optional>, therefore in a application like mine which does not use poi-ooxml the dependency commons-compress is missing.

It works for the unit tests in dbUnit, but not for such applications.

Proposal: Add a direct dependency to org.apache.commons:commons-compress

Discussion


Log in to post a comment.