Take the 2-minute tour ×

I've added poi 3.0.2 in repository .m2 and tried importing HSSFCell,HSSFSheet,HSSFWorkbook,HSSFRow. It is compiling without errors and when I try to run the application, error comes up.

I've added dependency in the core folder's pom.xml as


But it seems that only HSSFCell has the problem importing.I tried without importing that particular class and others are absolutely fine.I opened the jar and HSSFCell is actually present in the jar. The error is as follows.And it cause Destroying Singletons.

java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFCell
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getDeclaredMethods(Class.java:1763)
at java.beans.Introspector$1.run(Introspector.java:1265)
at java.security.AccessController.doPrivileged(Native Method)............

What could be the possible solution??

share|improve this question
Apache POI 3.0.2 dates from February 2008, so it's more than 4 years old! Why on earth are you not using a recent version? –  Gagravarr Mar 8 '12 at 16:16
add comment

2 Answers

up vote 1 down vote accepted

Remove 'provided' scope, which will then use the default (compile) scope.

Provided means that the jar isn't necessary at runtime, because it will be 'provided' by some container. If you use the Compile scope, then the jars should be available on the classpath at runtime.

share|improve this answer
add comment

I found another solution. If we give scope as provided,We can add the classpath in the jBoss run.bat and add the class to the jBoss lib folder.

It's working in either way

share|improve this answer
This does work, but isn't a really good solution. Situations where this might bite you are 1) if you want to upgrade your poi library you have to do it in both JBoss and in the maven file, which you will probably forget to do. If you do forget, you'll get hard-to-trace class resolution issues 2) If you run other apps on the server, they'll have have this jar in their classpath, which isn't necessary. You'll encounter less problems by letting maven handle the application's classes than JBoss. –  Roy Truelove Mar 12 '12 at 13:21
add comment

Your Answer


