No Such Method Error when creating JUnit test

后端 未结 5 797
忘了有多久
忘了有多久 2020-12-31 10:48

I\'ve tried figuring out this problem for the last 2 days with no luck. I\'m simply trying to create an annotation based JUnit test using the spring framework along with hi

相关标签:
5条回答
  • 2020-12-31 11:24

    I think you are picking up an incorrect version of asm.jar somewhere in the classpath you are using for your tests.

    0 讨论(0)
  • 2020-12-31 11:25

    I would like to share my suggestion for anyone who comes across this JUnit Testing for Android; none of the above worked for me and this was a simple fix:

    In Eclipse>>project properties>>Android>> make sure that the project you are testing is referenced under Library. 'is library' can remain unchecked

    0 讨论(0)
  • 2020-12-31 11:37

    I had a similar error using Spring 2.5 with Hibernate on NetBeans 6.5. One way I resolved the issue was downloading Spring 3.0 M2 and creating a NetBeans library I called Spring_3 using the jars from the distro. This library also had to include the antlr-runtime-3.0.jar.

    See: http://forum.springsource.org/showthread.php?t=65324

    -Leo

    0 讨论(0)
  • 2020-12-31 11:38

    Definitely you have different versions of your ClassWriter class at runtime than compile time.

    0 讨论(0)
  • 2020-12-31 11:47

    The java.lang.NoSuchMethodError always indicates that the version of a class that was on your compiler's classpath is different from the version of the class that is on your runtime classpath (had the method been missing at compile-time, the compile would have failed.)

    In this case, you had a different version of org.objectweb.asm.ClassWriter on your classpath at compile time than is on your runtime classpath.

    0 讨论(0)
提交回复
热议问题