Tag Archives: java.lang.NoSuchMethodError

[Solved] Springtest error: java.lang.nosuchmethoderror

Complete error reporting information:

"C:\Program Files\Java\jdk1.8.0_301\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\lib\idea_rt.jar=53174:C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\lib\idea_rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\plugins\junit\lib\junit5-rt.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2021.2.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_301\jre\lib\rt.jar;C:\Users\Cloud9\IdeaProjects\EveryThing-Framework\target\test-classes;C:\Users\Cloud9\IdeaProjects\EveryThing-Framework\target\classes;D:\Maven Local Repository\org\apache\curator\curator-framework\5.2.0\curator-framework-5.2.0.jar;D:\Maven Local Repository\org\apache\curator\curator-client\5.2.0\curator-client-5.2.0.jar;D:\Maven Local Repository\org\apache\zookeeper\zookeeper\3.6.3\zookeeper-3.6.3.jar;D:\Maven Local Repository\org\apache\zookeeper\zookeeper-jute\3.6.3\zookeeper-jute-3.6.3.jar;D:\Maven Local Repository\org\apache\yetus\audience-annotations\0.5.0\audience-annotations-0.5.0.jar;D:\Maven Local Repository\io\netty\netty-handler\4.1.63.Final\netty-handler-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-common\4.1.63.Final\netty-common-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-resolver\4.1.63.Final\netty-resolver-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-buffer\4.1.63.Final\netty-buffer-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-transport\4.1.63.Final\netty-transport-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-codec\4.1.63.Final\netty-codec-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-transport-native-epoll\4.1.63.Final\netty-transport-native-epoll-4.1.63.Final.jar;D:\Maven Local Repository\io\netty\netty-transport-native-unix-common\4.1.63.Final\netty-transport-native-unix-common-4.1.63.Final.jar;D:\Maven Local Repository\org\apache\curator\curator-recipes\5.2.0\curator-recipes-5.2.0.jar;D:\Maven Local Repository\commons-io\commons-io\2.11.0\commons-io-2.11.0.jar;D:\Maven Local Repository\commons-beanutils\commons-beanutils\1.7.0\commons-beanutils-1.7.0.jar;D:\Maven Local Repository\commons-logging\commons-logging\1.0.3\commons-logging-1.0.3.jar;D:\Maven Local Repository\org\javassist\javassist\3.26.0-GA\javassist-3.26.0-GA.jar;D:\Maven Local Repository\com\alibaba\fastjson\1.2.78\fastjson-1.2.78.jar;D:\Maven Local Repository\javax\servlet\javax.servlet-api\4.0.1\javax.servlet-api-4.0.1.jar;D:\Maven Local Repository\javax\servlet\jstl\1.2\jstl-1.2.jar;D:\Maven Local Repository\javax\servlet\jsp\javax.servlet.jsp-api\2.3.3\javax.servlet.jsp-api-2.3.3.jar;D:\Maven Local Repository\org\reflections\reflections\0.9.11\reflections-0.9.11.jar;D:\Maven Local Repository\com\google\guava\guava\20.0\guava-20.0.jar;D:\Maven Local Repository\mysql\mysql-connector-java\8.0.25\mysql-connector-java-8.0.25.jar;D:\Maven Local Repository\com\google\protobuf\protobuf-java\3.11.4\protobuf-java-3.11.4.jar;D:\Maven Local Repository\io\jsonwebtoken\jjwt\0.9.1\jjwt-0.9.1.jar;D:\Maven Local Repository\com\fasterxml\jackson\core\jackson-databind\2.9.6\jackson-databind-2.9.6.jar;D:\Maven Local Repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\Maven Local Repository\com\fasterxml\jackson\core\jackson-core\2.9.6\jackson-core-2.9.6.jar;D:\Maven Local Repository\org\apache\httpcomponents\httpclient\4.5.13\httpclient-4.5.13.jar;D:\Maven Local Repository\org\apache\httpcomponents\httpcore\4.4.13\httpcore-4.4.13.jar;D:\Maven Local Repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;D:\Maven Local Repository\org\apache\httpcomponents\httpmime\4.5.13\httpmime-4.5.13.jar;D:\Maven Local Repository\junit\junit\4.12\junit-4.12.jar;D:\Maven Local Repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\Maven Local Repository\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;D:\Maven Local Repository\org\slf4j\slf4j-log4j12\1.7.32\slf4j-log4j12-1.7.32.jar;D:\Maven Local Repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\Maven Local Repository\cglib\cglib\2.2.2\cglib-2.2.2.jar;D:\Maven Local Repository\asm\asm\3.3.1\asm-3.3.1.jar;D:\Maven Local Repository\org\apache\poi\poi\5.0.0\poi-5.0.0.jar;D:\Maven Local Repository\org\slf4j\jcl-over-slf4j\1.7.30\jcl-over-slf4j-1.7.30.jar;D:\Maven Local Repository\org\apache\commons\commons-collections4\4.4\commons-collections4-4.4.jar;D:\Maven Local Repository\org\apache\commons\commons-math3\3.6.1\commons-math3-3.6.1.jar;D:\Maven Local Repository\com\zaxxer\SparseBitSet\1.2\SparseBitSet-1.2.jar;D:\Maven Local Repository\org\apache\poi\poi-ooxml\5.0.0\poi-ooxml-5.0.0.jar;D:\Maven Local Repository\org\apache\poi\poi-ooxml-lite\5.0.0\poi-ooxml-lite-5.0.0.jar;D:\Maven Local Repository\org\apache\xmlbeans\xmlbeans\4.0.0\xmlbeans-4.0.0.jar;D:\Maven Local Repository\org\apache\commons\commons-compress\1.20\commons-compress-1.20.jar;D:\Maven Local Repository\com\github\virtuald\curvesapi\1.06\curvesapi-1.06.jar;D:\Maven Local Repository\org\bouncycastle\bcpkix-jdk15on\1.68\bcpkix-jdk15on-1.68.jar;D:\Maven Local Repository\org\bouncycastle\bcprov-jdk15on\1.68\bcprov-jdk15on-1.68.jar;D:\Maven Local Repository\org\apache\santuario\xmlsec\2.2.1\xmlsec-2.2.1.jar;D:\Maven Local Repository\com\fasterxml\woodstox\woodstox-core\5.2.1\woodstox-core-5.2.1.jar;D:\Maven Local Repository\org\codehaus\woodstox\stax2-api\4.2\stax2-api-4.2.jar;D:\Maven Local Repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.2\jakarta.xml.bind-api-2.3.2.jar;D:\Maven Local Repository\jakarta\activation\jakarta.activation-api\1.2.1\jakarta.activation-api-1.2.1.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-all\1.13\batik-all-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-anim\1.13\batik-anim-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-shared-resources\1.13\batik-shared-resources-1.13.jar;D:\Maven Local Repository\xml-apis\xml-apis-ext\1.3.04\xml-apis-ext-1.3.04.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-awt-util\1.13\batik-awt-util-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\xmlgraphics-commons\2.4\xmlgraphics-commons-2.4.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-bridge\1.13\batik-bridge-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-codec\1.13\batik-codec-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-constants\1.13\batik-constants-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-css\1.13\batik-css-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-dom\1.13\batik-dom-1.13.jar;D:\Maven Local Repository\xalan\xalan\2.7.2\xalan-2.7.2.jar;D:\Maven Local Repository\xalan\serializer\2.7.2\serializer-2.7.2.jar;D:\Maven Local Repository\xml-apis\xml-apis\1.4.01\xml-apis-1.4.01.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-ext\1.13\batik-ext-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-extension\1.13\batik-extension-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-gui-util\1.13\batik-gui-util-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-gvt\1.13\batik-gvt-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-i18n\1.13\batik-i18n-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-parser\1.13\batik-parser-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-rasterizer-ext\1.13\batik-rasterizer-ext-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-rasterizer\1.13\batik-rasterizer-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-script\1.13\batik-script-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-slideshow\1.13\batik-slideshow-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-squiggle-ext\1.13\batik-squiggle-ext-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-squiggle\1.13\batik-squiggle-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-svg-dom\1.13\batik-svg-dom-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-svgbrowser\1.13\batik-svgbrowser-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-svggen\1.13\batik-svggen-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-svgpp\1.13\batik-svgpp-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-svgrasterizer\1.13\batik-svgrasterizer-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-swing\1.13\batik-swing-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-transcoder\1.13\batik-transcoder-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-util\1.13\batik-util-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-ttf2svg\1.13\batik-ttf2svg-1.13.jar;D:\Maven Local Repository\org\apache\xmlgraphics\batik-xml\1.13\batik-xml-1.13.jar;D:\Maven Local Repository\de\rototor\pdfbox\graphics2d\0.30\graphics2d-0.30.jar;D:\Maven Local Repository\org\apache\pdfbox\pdfbox\2.0.22\pdfbox-2.0.22.jar;D:\Maven Local Repository\org\apache\pdfbox\fontbox\2.0.22\fontbox-2.0.22.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch\7.15.1\elasticsearch-7.15.1.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch-core\7.15.1\elasticsearch-core-7.15.1.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch-secure-sm\7.15.1\elasticsearch-secure-sm-7.15.1.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch-x-content\7.15.1\elasticsearch-x-content-7.15.1.jar;D:\Maven Local Repository\org\yaml\snakeyaml\1.26\snakeyaml-1.26.jar;D:\Maven Local Repository\com\fasterxml\jackson\dataformat\jackson-dataformat-smile\2.10.4\jackson-dataformat-smile-2.10.4.jar;D:\Maven Local Repository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.10.4\jackson-dataformat-yaml-2.10.4.jar;D:\Maven Local Repository\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.10.4\jackson-dataformat-cbor-2.10.4.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch-geo\7.15.1\elasticsearch-geo-7.15.1.jar;D:\Maven Local Repository\org\apache\lucene\lucene-core\8.9.0\lucene-core-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-analyzers-common\8.9.0\lucene-analyzers-common-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-backward-codecs\8.9.0\lucene-backward-codecs-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-grouping\8.9.0\lucene-grouping-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-highlighter\8.9.0\lucene-highlighter-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-join\8.9.0\lucene-join-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-memory\8.9.0\lucene-memory-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-misc\8.9.0\lucene-misc-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-queries\8.9.0\lucene-queries-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-queryparser\8.9.0\lucene-queryparser-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-sandbox\8.9.0\lucene-sandbox-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-spatial-extras\8.9.0\lucene-spatial-extras-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-spatial3d\8.9.0\lucene-spatial3d-8.9.0.jar;D:\Maven Local Repository\org\apache\lucene\lucene-suggest\8.9.0\lucene-suggest-8.9.0.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch-cli\7.15.1\elasticsearch-cli-7.15.1.jar;D:\Maven Local Repository\net\sf\jopt-simple\jopt-simple\5.0.2\jopt-simple-5.0.2.jar;D:\Maven Local Repository\com\carrotsearch\hppc\0.8.1\hppc-0.8.1.jar;D:\Maven Local Repository\org\lz4\lz4-java\1.8.0\lz4-java-1.8.0.jar;D:\Maven Local Repository\joda-time\joda-time\2.10.10\joda-time-2.10.10.jar;D:\Maven Local Repository\com\tdunning\t-digest\3.2\t-digest-3.2.jar;D:\Maven Local Repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\Maven Local Repository\org\apache\logging\log4j\log4j-api\2.11.1\log4j-api-2.11.1.jar;D:\Maven Local Repository\org\elasticsearch\jna\5.7.0-1\jna-5.7.0-1.jar;D:\Maven Local Repository\org\elasticsearch\elasticsearch-plugin-classloader\7.15.1\elasticsearch-plugin-classloader-7.15.1.jar;D:\Maven Local Repository\org\apache\activemq\activemq-all\5.16.3\activemq-all-5.16.3.jar;D:\Maven Local Repository\org\springframework\spring-core\5.2.18.RELEASE\spring-core-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-jcl\5.2.18.RELEASE\spring-jcl-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-web\5.2.18.RELEASE\spring-web-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-beans\5.2.18.RELEASE\spring-beans-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-oxm\5.2.18.RELEASE\spring-oxm-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-tx\5.2.18.RELEASE\spring-tx-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-jdbc\5.2.18.RELEASE\spring-jdbc-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-webmvc\5.2.18.RELEASE\spring-webmvc-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-context\5.2.18.RELEASE\spring-context-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-expression\5.2.18.RELEASE\spring-expression-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-aop\5.2.18.RELEASE\spring-aop-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-context-support\5.2.18.RELEASE\spring-context-support-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-test\5.2.18.RELEASE\spring-test-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-jms\5.2.18.RELEASE\spring-jms-5.2.18.RELEASE.jar;D:\Maven Local Repository\org\springframework\spring-messaging\5.2.18.RELEASE\spring-messaging-5.2.18.RELEASE.jar;D:\Maven Local Repository\javax\jms\javax.jms-api\2.0.1\javax.jms-api-2.0.1.jar;D:\Maven Local Repository\org\apache\xbean\xbean-spring\3.7\xbean-spring-3.7.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 cn.cloud9.test.activemq.springactivemq.SpringActiveMqConsumer,springActiveMqConsume
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/Maven%20Local%20Repository/org/slf4j/slf4j-log4j12/1.7.32/slf4j-log4j12-1.7.32.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Maven%20Local%20Repository/org/apache/activemq/activemq-all/5.16.3/activemq-all-5.16.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[2021-11-02 08:14:25 上午]:DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:139)SpringJUnit4ClassRunner constructor called with [class cn.cloud9.test.activemq.springactivemq.SpringActiveMqConsumer]
[2021-11-02 08:14:25 上午]:DEBUG org.springframework.test.context.BootstrapUtils.createCacheAwareContextLoaderDelegate(BootstrapUtils.java:96)Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
[2021-11-02 08:14:25 上午]:DEBUG org.springframework.test.context.BootstrapUtils.createBootstrapContext(BootstrapUtils.java:79)Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
[2021-11-02 08:14:25 上午]:DEBUG org.springframework.test.context.BootstrapUtils.resolveTestContextBootstrapper(BootstrapUtils.java:132)Instantiating TestContextBootstrapper for test class [cn.cloud9.test.activemq.springactivemq.SpringActiveMqConsumer] from class [org.springframework.test.context.support.DefaultTestContextBootstrapper]

java.lang.NoSuchMethodError: org.springframework.util.Assert.notNull(Ljava/lang/Object;Ljava/util/function/Supplier;)V

    at org.springframework.test.context.support.ContextLoaderUtils.resolveContextConfigurationAttributes(ContextLoaderUtils.java:244)
    at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildMergedContextConfiguration(AbstractTestContextBootstrapper.java:295)
    at org.springframework.test.context.support.AbstractTestContextBootstrapper.buildTestContext(AbstractTestContextBootstrapper.java:108)
    at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:137)
    at org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:122)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:151)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:142)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
    at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:36)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:50)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)


Process finished with exit code -1

The problem appears in the annotation @ runwith using the spring test component

package cn.cloud9.test.activemq.springactivemq;


import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;


@RunWith(SpringJUnit4ClassRunner.class) 
@ContextConfiguration(locations = {"classpath:ActiveMQ-Consumer.xml"}) 
public class SpringActiveMqConsumer {

    @Test
    public void springActiveMqConsume() throws Exception {
        // ApplicationContext ac = new ClassPathXmlApplicationContext("ActiveMQ-Consumer.xml");
        System.in.read();
    }
}

All spring component configuration versions:

<spring-version>5.2.18.RELEASE</spring-version>

JUnit beta:

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>

The solution is to set a separate version for springtest:

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <!--<version>${spring-version}</version>-->
            <version>4.1.6.RELEASE</version>
        </dependency>

 

[Solved] Android studio preview view Error: java.lang.NoSuchMethodError

Error Message:

 

Details:

java.lang.NoSuchMethodError: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;
at com.android.layoutlib.bridge.impl.ResourceHelper.getInternalComplexColor(ResourceHelper.java:146)
at com.android.layoutlib.bridge.impl.ResourceHelper.getColorStateList(ResourceHelper.java:231)
at android.content.res.BridgeTypedArray.getColorStateList(BridgeTypedArray.java:308)
at android.widget.TextView.<init>(TextView.java:776)
at android.widget.TextView.<init>(TextView.java:705)
at android.widget.TextView.<init>(TextView.java:701)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:50)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:45)
at com.android.layoutlib.bridge.MockView.<init>(MockView.java:41)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:163)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:834)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at com.android.layoutlib.bridge.bars.CustomBar.<init>(CustomBar.java:95)
at com.android.layoutlib.bridge.bars.StatusBar.<init>(StatusBar.java:67)
at com.android.layoutlib.bridge.impl.Layout.createStatusBar(Layout.java:222)
at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:144)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:213)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:426)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:510)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:498)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:498)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:72)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:610)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:607)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:362)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:607)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:629)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:652)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:80)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:594)
at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:589)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

 

Solution:

Just replace it with a lower version.