Unit Test error after spring access swagger

Source: Internet
Author: User

2017-05-16 11:58:05.276 INFO 11268---[main] s.c.a.annotationconfigapplicationcontext:refreshing Org.spring[email Pro Tected]58bf3596:startup Date [Tue May 11:58:05 CST 2017]; Root of context Hierarchy

2017-05-16 11:58:06.452 INFO 11268---[main] trationdelegate$beanpostprocessorchecker:bean ' Org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration ' of type [ org.springframework.transaction.annotation.proxytransactionmanagementconfiguration$ $EnhancerBySpringCGLIB $$ CFBCB6CB] is not eligible for getting processed by all beanpostprocessors (for example:not eligible for auto-proxying)
2017-05-16 11:58:07.671 WARN 11268---[main] s.c.a.annotationconfigapplicationcontext:exception encountered during con Text initialization-cancelling Refresh Attempt:org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating Bean with Name ' documentationpluginsbootstrapper ' defined in URL [jar:file:/e:/jar/io/springfox/ springfox-spring-web/2.2.2/springfox-spring-web-2.2.2.jar!/springfox/documentation/spring/web/plugins/ Documentationpluginsbootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' Webmvcrequesthandlerprovider ' defined in URL [jar:file:/e:/jar/io/springfox/springfox-spring-web/2.2.2/ Springfox-spring-web-2.2.2.jar!/springfox/documentation/spring/web/plugins/webmvcrequesthandlerprovider.class] : Unsatisfied dependency expressed through constructor parameter 0; Nested exception is Org.springframework.beanS.factory.nosuchbeandefinitionexception:no qualifying Bean of type ' java.util.list< Org.springframework.web.servlet.mvc.method.requestmappinginfohandlermapping> ' available:expected at least 1 bean Which qualifies as Autowire candidate. Dependency annotations: {}
2017-05-16 11:58:07.675 WARN 11268---[main] o.s.boot.springapplication:error handling failed (Error creating bean wit H name ' Delegatingapplicationlistener ' defined in class path resource [org/springframework/security/config/annotation/ Web/configuration/websecurityconfiguration.class]: Beanpostprocessor before instantiation of Bean failed; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration ': Initialization of beans failed ; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No bean named ' Org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry ' available)
2017-05-16 11:58:07.745 ERROR 11268---[main] o.s.boot.springapplication:application startup failed

Org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating bean with Name ' Documentationpluginsbootstrapper ' defined in URL [jar:file:/e:/jar/io/springfox/springfox-spring-web/2.2.2/ springfox-spring-web-2.2.2.jar!/springfox/documentation/spring/web/plugins/ Documentationpluginsbootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; Nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating beans with Name ' Webmvcrequesthandlerprovider ' defined in URL [jar:file:/e:/jar/io/springfox/springfox-spring-web/2.2.2/ Springfox-spring-web-2.2.2.jar!/springfox/documentation/spring/web/plugins/webmvcrequesthandlerprovider.class] : Unsatisfied dependency expressed through constructor parameter 0; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type ' Java.util.list<org.springframework.web.servlet.mvc.method.requestmappinginfohandlermapping> ' Available:expected at least 1 bean which qualifies as Autowire candidate. Dependency annotations: {}
At Org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (Constructorresolver.java : 749) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (Constructorresolver.java : 189) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor ( abstractautowirecapablebeanfactory.java:1193) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance ( abstractautowirecapablebeanfactory.java:1095) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:513) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:306) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:302) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:197) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:761) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:866) ~[spring-context-4.3.8.release.jar:4.3.8.release]
At Org.springframework.context.support.AbstractApplicationContext.refresh (abstractapplicationcontext.java:542) ~ [Spring-context-4.3.8.release.jar:4.3.8.release]
At Org.springframework.boot.SpringApplication.refresh (springapplication.java:737) ~[ Spring-boot-1.5.3.release.jar:1.5.3.release]
At Org.springframework.boot.SpringApplication.refreshContext (springapplication.java:370) ~[ Spring-boot-1.5.3.release.jar:1.5.3.release]
At Org.springframework.boot.SpringApplication.run (springapplication.java:314) ~[spring-boot-1.5.3.release.jar : 1.5.3.RELEASE]
At Org.springframework.boot.test.SpringApplicationContextLoader.loadContext (Springapplicationcontextloader.java : 103) [Spring-boot-test-1.4.2.release.jar:1.4.2.release]
At Org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal ( DEFAULTCACHEAWARECONTEXTLOADERDELEGATE.JAVA:98) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext ( defaultcacheawarecontextloaderdelegate.java:116) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.support.DefaultTestContext.getApplicationContext (defaulttestcontext.java:83 ) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies ( dependencyinjectiontestexecutionlistener.java:117) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance ( DEPENDENCYINJECTIONTESTEXECUTIONLISTENER.JAVA:83) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.TestContextManager.prepareTestInstance (testcontextmanager.java:230) [ Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest (springjunit4classrunner.java:228) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.junit4.springjunit4classrunner$1.runreflectivecall ( springjunit4classrunner.java:287) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.junit.internal.runners.model.ReflectiveCallable.run (reflectivecallable.java:12) [junit-4.12.jar:4.12]
At Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock (springjunit4classrunner.java:289 ) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild (springjunit4classrunner.java:247) [ Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild (springjunit4classrunner.java:94) [ Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.junit.runners.parentrunner$3.run (parentrunner.java:290) [junit-4.12.jar:4.12]
At Org.junit.runners.parentrunner$1.schedule (parentrunner.java:71) [junit-4.12.jar:4.12]
At Org.junit.runners.ParentRunner.runChildren (parentrunner.java:288) [junit-4.12.jar:4.12]
At org.junit.runners.parentrunner.access$000 (parentrunner.java:58) [junit-4.12.jar:4.12]
At Org.junit.runners.parentrunner$2.evaluate (parentrunner.java:268) [junit-4.12.jar:4.12]
At Org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate ( RUNBEFORETESTCLASSCALLBACKS.JAVA:61) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate ( RUNAFTERTESTCLASSCALLBACKS.JAVA:70) [Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.junit.runners.ParentRunner.run (parentrunner.java:363) [junit-4.12.jar:4.12]
At Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run (springjunit4classrunner.java:191) [ Spring-test-4.3.8.release.jar:4.3.8.release]
At Org.junit.runner.JUnitCore.run (junitcore.java:137) [junit-4.12.jar:4.12]
At Com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs (junit4ideatestrunner.java:68) [Junit-rt.jar:na]
At Com.intellij.rt.execution.junit.ideatestrunner$repeater.startrunnerwithargs (IdeaTestRunner.java:51) [ Junit-rt.jar:na]
At Com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart (junitstarter.java:237) [Junit-rt.jar:na]
At Com.intellij.rt.execution.junit.JUnitStarter.main (junitstarter.java:70) [Junit-rt.jar:na]
At Sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) ~[na:1.7.0_79]
At Sun.reflect.NativeMethodAccessorImpl.invoke (nativemethodaccessorimpl.java:57) ~[na:1.7.0_79]
At Sun.reflect.DelegatingMethodAccessorImpl.invoke (delegatingmethodaccessorimpl.java:43) ~[na:1.7.0_79]
At Java.lang.reflect.Method.invoke (method.java:606) ~[na:1.7.0_79]
At Com.intellij.rt.execution.application.AppMain.main (appmain.java:147) [Idea_rt.jar:na]
caused by:org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating bean with Name ' Webmvcrequesthandlerprovider ' defined in URL [jar:file:/e:/jar/io/springfox/springfox-spring-web/2.2.2/ Springfox-spring-web-2.2.2.jar!/springfox/documentation/spring/web/plugins/webmvcrequesthandlerprovider.class] : Unsatisfied dependency expressed through constructor parameter 0; Nested exception is Org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type ' Java.util.list<org.springframework.web.servlet.mvc.method.requestmappinginfohandlermapping> ' available: Expected at least 1 bean which qualifies as Autowire candidate. Dependency annotations: {}
At Org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (Constructorresolver.java : 749) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor (Constructorresolver.java : 189) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor ( abstractautowirecapablebeanfactory.java:1193) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance ( abstractautowirecapablebeanfactory.java:1095) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:513) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.abstractbeanfactory$1.getobject (abstractbeanfactory.java:306) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (abstractbeanfactory.java:302) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:202) ~[ Spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (dependencydescriptor.java:208 ) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:1138) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:1066) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument ( constructorresolver.java:835) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (Constructorresolver.java : 741) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
... Common frames omitted
caused By:org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type ' java.util.List <org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping> ' available:expected at least 1 Bean which qualifies as Autowire candidate. Dependency annotations: {}
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound ( defaultlistablebeanfactory.java:1486) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( defaultlistablebeanfactory.java:1104) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:1066) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument ( constructorresolver.java:835) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
At Org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray (Constructorresolver.java : 741) ~[spring-beans-4.3.8.release.jar:4.3.8.release]
... Common frames omitted

Workaround:

The test case is annotated with @webappconfiguration.

Reference blog:

http://blog.csdn.net/zheng0518/article/details/52213865

Unit Test error after spring access swagger

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.