"JUnit Error" Java.lang.IncompatibleClassChangeError

Source: Internet
Author: User

Error when using JUnit to test spring:

1Java.lang.IncompatibleClassChangeError:classOrg.springframework.core.localvariabletableparameternamediscoverer$parameternamediscoveringvisitor hasInterfaceOrg.springframework.asm.ClassVisitor asSuper class2 At Java.lang.ClassLoader.defineClass1 (Native Method)3At Java.lang.ClassLoader.defineClass (classloader.java:800)4At Java.security.SecureClassLoader.defineClass (secureclassloader.java:142)5At Java.net.URLClassLoader.defineClass (urlclassloader.java:449)6At java.net.urlclassloader.access$100 (urlclassloader.java:71)7At Java.net.urlclassloader$1.run (urlclassloader.java:361)8At Java.net.urlclassloader$1.run (urlclassloader.java:355)9 At java.security.AccessController.doPrivileged (Native Method)TenAt Java.net.URLClassLoader.findClass (urlclassloader.java:354) OneAt Java.lang.ClassLoader.loadClass (classloader.java:425) AAt Sun.misc.launcher$appclassloader.loadclass (launcher.java:308) -At Java.lang.ClassLoader.loadClass (classloader.java:358) -At Org.springframework.core.LocalVariableTableParameterNameDiscoverer.inspectClass ( localvariabletableparameternamediscoverer.java:114) theAt Org.springframework.core.LocalVariableTableParameterNameDiscoverer.getParameterNames ( localvariabletableparameternamediscoverer.java:87) -At Org.springframework.core.PrioritizedParameterNameDiscoverer.getParameterNames ( Prioritizedparameternamediscoverer.java:65) -At Org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (Constructorresolver.java : 182) -At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor ( abstractautowirecapablebeanfactory.java:1143) +At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance ( abstractautowirecapablebeanfactory.java:1046) -At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:510) +At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:482) AAt Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:306) atAt Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) -At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:302) -At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:197) -At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:772) -At Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:839) -At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:538) inAt Org.springframework.context.support.filesystemxmlapplicationcontext.<init> ( filesystemxmlapplicationcontext.java:140) -At Org.springframework.context.support.filesystemxmlapplicationcontext.<init> ( filesystemxmlapplicationcontext.java:84) toAt Com.it.sxd.SayHelloTest2.testSayHello (sayhellotest2.java:11) + At sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) -At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57) theAt Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) *At Java.lang.reflect.Method.invoke (method.java:606) $At Org.junit.runners.model.frameworkmethod$1.runreflectivecall (frameworkmethod.java:50)Panax NotoginsengAt Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:12) -At Org.junit.runners.model.FrameworkMethod.invokeExplosively (frameworkmethod.java:47) theAt Org.junit.internal.runners.statements.InvokeMethod.evaluate (invokemethod.java:17) +At Org.junit.runners.ParentRunner.runLeaf (parentrunner.java:325) AAt Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:78) theAt Org.junit.runners.BlockJUnit4ClassRunner.runChild (blockjunit4classrunner.java:57) +At Org.junit.runners.parentrunner$3.run (parentrunner.java:290) -At Org.junit.runners.parentrunner$1.schedule (parentrunner.java:71) $At Org.junit.runners.ParentRunner.runChildren (parentrunner.java:288) $At org.junit.runners.parentrunner.access$000 (parentrunner.java:58) -At Org.junit.runners.parentrunner$2.evaluate (parentrunner.java:268) -At Org.junit.runners.ParentRunner.run (parentrunner.java:363) theAt Org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run (junit4testreference.java:50) -At Org.eclipse.jdt.internal.junit.runner.TestExecution.run (testexecution.java:38)WuyiAt Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:459) theAt Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (remotetestrunner.java:675) -At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (remotetestrunner.java:382) WuAt Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (remotetestrunner.java:192)
View Code

This error has a class called Classmetadatareadingvisitor, with an interface called Classvisitor as the parent class . But everyone knows thatthe relationship between classes and interfaces in Java can only be implemented, not inherited.

So this is the collision of the package:

Remove this rack package

"JUnit Error" Java.lang.IncompatibleClassChangeError

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.