您的位置:首页 > 编程语言 > Java开发

Java Exception: java.lang.NoSuchFieldError

2012-07-30 15:33 531 查看
Issue:

When you access static constant in your program, especially in Web app, you may found that some of static field cannot be access. You will get java.lang.NoSuchFieldError exception.

Reason:

This exception is usually happened when you build your class into a jar. But you were trying to access same class from Class folder. So JVM may be confused. It might read wrong class which is not contains your field.

Solution:

Double check if there is a duplicate class defined in Jar. And remove one of duplicate class from your app.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: