Maven 依赖项存在但 classDefNotFound?
我的 pom 文件中有以下依赖项:-
<dependency>
<groupId>org.jvnet.ws.wadl</groupId>
<artifactId>wadl-core</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
jar 文件存在于系统上,并且可以解决依赖项。但是当代码运行时,它会在 java.lang.ClassNotFoundException: org.jvnet.ws.wadl.util.DSDispatcher 上失败。 DSDispatcher 存在于 jar 文件和正确的包中。谁能建议问题可能是什么?我尝试将 wadl-core pom 中的所有依赖项添加到我的 pom 中,但这没有帮助,并且我尝试了依赖项的各种范围。
谢谢!
I have the following dependency in my pom file:-
<dependency>
<groupId>org.jvnet.ws.wadl</groupId>
<artifactId>wadl-core</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
the jar file exists on the system and the dependency can be resolved. but when the code is run it fails on java.lang.ClassNotFoundException: org.jvnet.ws.wadl.util.DSDispatcher. DSDispatcher exists in the jar file and in the correct package. Can anyone suggest what the issue might be? I've tried adding all the dependencies from wadl-core pom to my pom, that has not helped and i've tried the various scopes on my dependency.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您在评论中的回答,您的项目似乎被打包成一个war文件(或ear)。与其将 wadl-core 放入 JBoss lib 中,不如将其嵌入到您的存档中。
如果您在应用程序的 pom.xml 中使用
war
以及问题中提到的依赖项声明,则 wadl-core 应出现在 WEB-INF/lib 中在你的战争文件中。According to your answers in the comments, it seems you're project is packaged into a war file (or ear). Rather than putting wadl-core in JBoss lib, it should really be embedded into your archive.
If you use
<packaging>war</packaging>
into the pom.xml of your application along with the declaration of dependency mentioned in your question, wadl-core should be present into WEB-INF/lib in your war file.