Java Exception: java.lang.NoSuchFieldError
2012-07-30 15:33
465 查看
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.
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.
相关文章推荐
- nested exception is java.lang.NoSuchFieldError: FAIL_ON_SYMBOL_HASH_OVERFLOW
- elasticsearch 报出 Exception in thread "main" java.lang.NoSuchFieldError: LUCENE_3_6
- Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE
- Exception in thread "main" java.lang.NoSuchFieldError: level
- @valid在SpringMVC中报错[Handler processing failed; nested exception is java.lang.NoSuchFieldError:TRACE
- exception is java.lang.NoSuchFieldError: INSTANCE
- nested exception is java.lang.NoSuchFieldError: TRACE
- Exception:java.lang.NoSuchFieldError: TRACE
- Exception in thread "main" java.lang.NoSuchFieldError的 一种解决办法
- java运行报错:nested exception is java.lang.NoSuchFieldError: INSTANCE,但使用@Test测试是好的
- nested exception is java.lang.NoSuchFieldError: QUALIFIED
- hive Exception in thread "main" java.lang.NoSuchFieldError: type
- Java Exception: java.lang.NoSuchFieldError
- ssh整合报错,nested exception is java.lang.NoSuchFieldError: TRACE
- google protobuf java.lang.NoSuchFieldError: alwaysUseFieldBuilders问题
- java.lang.NoSuchFieldError: TRACE
- Caused by: java.lang.NoSuchFieldError: TRACE
- java.lang.NoSuchFieldError: No static field ib_back of type I in class Lcom/example/demo/R$id; or
- java.lang.NoSuchFieldError: defe…
- java.lang.NoSuchFieldError: INSTANCE 错误