sainath
sainath

Reputation: 203

poi HSSFCell not found exception in Spring Framework

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

 <dependency>
        <groupId>org.apache</groupId>
        <artifactId>poi</artifactId>
        <version>3.0.2</version>
        <scope>provided</scope>
    </dependency>

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??

Upvotes: 0

Views: 632

Answers (2)

sainath
sainath

Reputation: 203

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

Upvotes: 0

Roy Truelove
Roy Truelove

Reputation: 22466

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.

Upvotes: 1

Related Questions