简体   繁体   English

调试:java.lang.NoSuchMethodError

[英]DEBUG: java.lang.NoSuchMethodError

I encountered a java.lang.NoSuchMethodError when running a program. 运行程序时遇到java.lang.NoSuchMethodError

This link explained the error very clearly. 该链接非常清楚地解释了该错误。

I am trying to debug this exception in Eclipse Kepler. 我正在尝试在Eclipse Kepler中调试此异常。 The link recommends setting the JVM options -Dibm.cl.verbose=[class name] , and -verbose:dynload . 该链接建议设置JVM选项-Dibm.cl.verbose=[class name]-verbose:dynload

I set these options under Run As -> Run Configurations -> Arguments -> VM arguments. 我在运行方式->运行配置->参数-> VM参数下设置这些选项。 However, after setting the options the JVM is not outputting any additional debug information. 但是,设置选项后,JVM不会输出任何其他调试信息。

Exception in thread "main" java.lang.NoSuchMethodError: [package].Argument.getConsole()Lcom/beust/jcommander/internal/Console;

Why is the JVM not outputting the expected debug information? JVM为什么不输出预期的调试信息?

According to the code on this page : https://github.com/cbeust/jcommander/blob/master/src/main/java/com/beust/jcommander/WrappedParameter.java 根据此页面上的代码: https : //github.com/cbeust/jcommander/blob/master/src/main/java/com/beust/jcommander/WrappedParameter.java

Jcommander can throw a NoSuchMethodException itself if you've led it to expect a list (that should have a 'put' method) but give it a type that doesn't have that method. 如果您让Jcommander期望一个列表(应该有一个“ put”方法)但给它一个没有该方法的类型,它可以抛出NoSuchMethodException本身。

[SOLVED] [解决了]

So it was a conflict with some dependency issue. 因此,它与某些依赖关系问题发生冲突。 Basically I had Maven version 1.17 and 1.30 somehow. 基本上我以某种方式拥有Maven版本1.17和1.30。 I deleted the older one and the problem was resolved. 我删除了旧的,问题就解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM