[英]Getting a ClassNotFoundException even though I have the correct jar
This is from my pom.xml: 这来自我的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. 我在Spring Tool Suite上没有看到任何错误消息(非常类似于Eclipse),并且POI库已成功导入。 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. 此外,代码在OSGi捆绑软件中运行,并且poi jar与其他部署在一起。
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. 但是我的Workbook.class位于poi内部,而不是poi-ooxml。 How do I make maven to look inside of poi instead of poi-ooxml?
我如何使Maven在poi内部而不是poi-ooxml中查找?
Your question is not very clear... Are you using Eclipse when this error occur or maven? 您的问题不是很清楚...发生此错误或使用Maven时是否正在使用Eclipse?
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 在pom.xml的主目录中,这将为您提供更多信息
Usually when you have an error such ClassNotFoundException it means that you miss a dependency in the pom.xml. 通常,当您遇到诸如ClassNotFoundException之类的错误时,这意味着您会错过pom.xml中的依赖项。
Go over all your dependencies and check what is missing in the pom. 查看所有依赖项,检查pom中缺少的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.