I am using Apache POI to read some Excel files. I created a console application to complete the task, after which I tried to integrate the code into Spring MVC webApp (nothing special, I know). I included the same Jar files in my Classpath, but whenever I try to run the code, I get this error:
java.lang.NoClassDefFoundError : org/apache/poi/ss/usermodel/Font
I believe that the Font class was found at compile time, but not at runtime. I am sure that the problem is not in ClassPath, but I cannot figure out how to solve this.
EDIT: when I copy the same code in a new class with the main method (in the same web project) and run my web application as a console java application, it works.
source
share