使用 jetty-maven-plugin 时出现 NoClassDefFoundError
我收到:
he Cause java.lang.NoClassDefFoundError Msg:net/spy/memcached/MemcachedClient
在 eclipse 中执行 jetty:run -e 时。为什么不将此依赖项添加到类路径中?
I am getting a:
he Cause java.lang.NoClassDefFoundError Msg:net/spy/memcached/MemcachedClient
When executing jetty:run -e in eclipse. Why isn't this dependency being added into the classpath?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您希望将其添加到哪个类路径?如果项目中的某些内容尝试加载它,请确保您有一个包含该类的项目依赖项。它看起来像 它来自服务混合。如果您已向 Jetty 本身添加了某些内容以使其需要该类,则 将依赖项添加到 jetty插件。
Which classpath do you expect it to be added to? If something in your project is trying to load it, ensure you have a project dependency that has that class in it. It looks like it comes from ServiceMix. If you've added something to Jetty itself to make it require that class, then add the dependency to the jetty plugin.
您的代码缺少运行时依赖项。我在 Maven Central 中搜索了缺少的类
http://search.maven.org/#search|ga|1|fc%3A%22net.spy.memcached.MemcachedClient%22
尝试将以下内容添加到您的聚甲醛:
Your code is missing a runtime dependency. I searched Maven Central for the missing class
http://search.maven.org/#search|ga|1|fc%3A%22net.spy.memcached.MemcachedClient%22
Try adding the following to your POM:
依赖项有一个提供的范围。改变这个。
The dependency had a provided scope. Change this.