noclassdeffounderror

2izufjch  于 2021-07-24  发布在  Java
关注(0)|答案(1)|浏览(312)

我正在尝试将apacheignite添加到eclipse中使用ant构建的现有csv项目中(这些都不是我可以控制的)。
我已将以下jar添加到构建路径:
cache-api-1.1.1.jar
ignite-core-2.9.1.jar
ignite-core-2.9.1-javadoc.jar
ignite-core-2.9.1-sources.jar
点火Spring-2.9.1
ignite-spring-2.9.1-javadoc-ignite-spring-2.9.1-sources
我可以在eclipse中从ignite导入所需的内容,并且项目符合要求,没有错误,但是当我开始启动符合要求的应用程序时,会出现以下错误:
org.springframework.beans.factory.beancreationexception:创建名为“x”的bean时出错,该bean在类路径资源[yyyyy.xml]中定义:bean示例化失败;嵌套异常为org.springframework.beans.beaninstantiationexception:未能示例化[x]:构造函数引发异常;嵌套的异常是java.lang.noclassdeffounderror:org/apache/ignite/spi/discovery/tcp/ipfinder/tcpdiscoveryipfinder。。。。原因:构造函数抛出异常;嵌套的异常是java.lang.noclassdeffounderror:org/apache/ignite/spi/discovery/tcp/ipfinder/tcpdiscoveryipfinder
但是在eclipse中,我可以在projectexplorer中展开referenced libraries->ignite-core-2.9.1.jar并查看spi.discovery/tcp/ipfinder/tcpdiscoveryipfinder
另外,未能示例化的类甚至不使用ignite或tcpdiscoveryipfinder。
在过去,这个过程在向项目添加mockito之类的东西时是有效的,但在本例中不是。

aemubtdh

aemubtdh1#

好的,在仔细考虑之后,我意识到我需要将ignite jar添加到ApacheTomcat/lib中。
这就解决了问题。
至于mokito之前没有出现这种情况的原因是,所有单元测试都只在eclipse中运行,而不是在实际应用程序中运行。

相关问题