brainmassage
brainmassage

Reputation: 1254

Getting a ClassNotFoundException even though I have the correct jar

This is from my pom.xml:

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.9</version>
    </dependency>

And this is from my error message:

java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook not 

found by poi-ooxml [355]

I don't see any error messages on my Spring Tool Suite(very similar to Eclipse), and POI libraries are successfully imported. I really can't understand why am I getting this error.

Also the code runs in an OSGi bundle, and poi jars are deployed along others.

UPDATE: Ok I have found something: The error says:

java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Workbook not 

found by poi-ooxml [355]

But my Workbook.class is inside of poi instead of poi-ooxml. How do I make maven to look inside of poi instead of poi-ooxml?

Upvotes: 0

Views: 530

Answers (1)

raven99
raven99

Reputation: 261

Your question is not very clear... Are you using Eclipse when this error occur or maven?

Usually, the best thing is to run

mvn clean install

in the home directory of pom.xml and this will give you a lot more information

Usually when you have an error such ClassNotFoundException it means that you miss a dependency in the pom.xml.

Go over all your dependencies and check what is missing in the pom.

Upvotes: 1

Related Questions