线程“主”中的异常java.lang.NoSuchFieldError:VERSION_5

时间:2018-08-15 12:23:42

标签: java

我正在关注https://docs.oracle.com/cd/E37115_01/dev.1112/e27134/as_api.htm#AIDEV6370,并使用文档中提到的示例代码。即AccessClient。

当我通过eclipse进行编译时,我得到以下错误提示。

Exception in thread "main" java.lang.NoSuchFieldError: VERSION_5
    at oracle.security.am.asdk.AccessClient.<init>(AccessClient.java:216)
    at oracle.security.am.asdk.AccessClient.createDefaultInstance(AccessClient.java:358)
    at JAccessClient.main(JAccessClient.java:14)

我已经检查并修改了

public static final String m_configLocation = "C:\\U01\\eclipse-workspace\\OamAuthenticationService";`

但是,仍然是同样的问题。

1 个答案:

答案 0 :(得分:0)

Java API documentation for the exception说:

public class NoSuchFieldError
extends IncompatibleClassChangeError

Thrown if an application tries to access or modify a specified field
of an object, and that object no longer has that field.

Normally, this error is caught by the compiler; this error can only
occur at run time if the definition of a class has incompatibly changed.

这告诉您您需要了解的所有内容。也就是说,您可能正在使用过期的类来构建应用程序。尝试清理并重建所有内容。