Springboot error (v) Failed to load ApplicationContext (2)

Source: Internet
Author: User
Tags bind
java.lang.IllegalStateException:Failed to load ApplicationContext at Org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext ( defaultcacheawarecontextloaderdelegate.java:124) at
	Org.springframework.test.context.support.DefaultTestContext.getApplicationContext (defaulttestcontext.java:83) At Org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary ( servlettestexecutionlistener.java:189) at Org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance ( servlettestexecutionlistener.java:131) at Org.springframework.test.context.TestContextManager.prepareTestInstance (testcontextmanager.java:230) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest (springjunit4classrunner.java:228) at Org.springframework.test.context.junit4.springjunit4classrunner$1.runreflectivecall ( springjunit4classrunner.java:287) at Org.junit.internal.runners.model.ReflectiveCallable.run (refleCTIVECALLABLE.JAVA:12) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock ( springjunit4classrunner.java:289) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild ( springjunit4classrunner.java:247) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild ( springjunit4classrunner.java:94) 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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate ( RUNBEFORETESTCLASSCALLBACKS.JAVA:61) at Org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate ( RUNAFTERTESTCLASSCALLBACKS.JAVA:70) at Org.junit.runners.ParentRunner.run (Parentrunner.java:363) at Org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run ( springjunit4classrunner.java:191) at Org.junit.runner.JUnitCore.run (junitcore.java:137) at Com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs (junit4ideatestrunner.java:68) at Com.intellij.rt.execution.junit.ideatestrunner$repeater.startrunnerwithargs (IdeaTestRunner.java:47) at Com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart (junitstarter.java:242) at Com.intellij.rt.execution.junit.JUnitStarter.main (junitstarter.java:70) caused by: Org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating bean with Name ' Tk.mybatis.mapper.autoconfigure.MapperAutoConfiguration ': Unsatisfied dependency expressed through field ' Properties '; Nested exception is org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Mapper-tk.mybatis.mapper.autoconfigure.mapperproperties ': Could not bind properties to Mapperproperties (prefix= Mapper Ignoreinvalidfields=false, Ignoreunknownfields=true, Ignorenestedproperties=false); Nested exception is org.springframework.validation.bindexception:org.springframework.boot.bind.relaxeddatabinder$ Relaxedbeanpropertybindingresult:1 errors field Error in object ' Mapper ' on Field ' mappers[0] ': Rejected value [com.progr Ammersupermarket.users.util.MyMapper]; codes [Typemismatch.mapper.mappers[0],typemismatch.mapper.mappers,typemismatch.mappers[0],typemismatch.mappers, Typemismatch]; arguments [Org.springframework.context.support.DefaultMessageSourceResolvable:codes [mapper.mappers[0],mappers[0 ]]; arguments []; Default message [Mappers[0]]; Default message [Failed to convert property value of type ' java.lang.String ' to required type ' java.lang.Class ' for proper Ty ' mappers[0] '; Nested exception is java.lang.IllegalArgumentException:Cannot find class [ Com.programmersupermarket.users.util.MyMapper]] at Org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autoWiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:588) at Org.springframework.beans.factory.annotation.InjectionMetadata.inject (injectionmetadata.java:88) at Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues ( autowiredannotationbeanpostprocessor.java:366) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean ( abstractautowirecapablebeanfactory.java:1264) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:553) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:483) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:306) at 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:761) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:867) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:543) at Org.springframework.boot.SpringApplication.refresh ( springapplication.java:693) at Org.springframework.boot.SpringApplication.refreshContext (Springapplication.java : In Org.springframework.boot.SpringApplication.run (springapplication.java:303) at Org.springframework.boot.test.context.SpringBootContextLoader.loadContext (springbootcontextloader.java:120) at Org.springframework.test.context.cache.DefaultCacheAwareContextloaderdelegate.loadcontextinternal (defaultcacheawarecontextloaderdelegate.java:98) at Org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext ( defaultcacheawarecontextloaderdelegate.java:116) ... caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' Mapper-tk.mybatis.mapper.autoconfigure.mapperproperties ': Could not bind properties to Mapperproperties (prefix= Mapper, Ignoreinvalidfields=false, Ignoreunknownfields=true, Ignorenestedproperties=false); Nested exception is org.springframework.validation.bindexception:org.springframework.boot.bind.relaxeddatabinder$ Relaxedbeanpropertybindingresult:1 errors field Error in object ' Mapper ' on Field ' mappers[0] ': Rejected value [com.progr Ammersupermarket.users.util.MyMapper]; codes [Typemismatch.mapper.mappers[0],typemismatch.mapper.mappers,typemismatch.mappers[0],typemismatch.mappers, Typemismatch]; arguments [Org.springframework.context.support.DefAultmessagesourceresolvable:codes [Mapper.mappers[0],mappers[0]]; arguments []; Default message [Mappers[0]]; Default message [Failed to convert property value of type ' java.lang.String ' to required type ' java.lang.Class ' for proper Ty ' mappers[0] '; Nested exception is java.lang.IllegalArgumentException:Cannot find class [ Com.programmersupermarket.users.util.MyMapper]] at Org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization (configurationpropertiesbindingpostprocessor.java:334) at Org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization (configurationpropertiesbindingpostprocessor.java:291) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization (abstractautowirecapablebeanfactory.java:409) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean (Abstractautowirecapablebeanfactory.java:1620) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:555) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:483) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:306) at 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:202) at
	Org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate (dependencydescriptor.java:208) At Org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency ( Defaultlistablebeanfactory.java:1138) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency ( defaultlistablebeanfactory.java:1066) at Org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject (autowiredannotationbeanpostprocessor.java:585) ... More caused by:org.springframework.validation.bindexception:org.springframework.boot.bind.relaxeddatabinder$ Relaxedbeanpropertybindingresult:1 errors field Error in object ' Mapper ' on Field ' mappers[0] ': Rejected value [com.progr Ammersupermarket.users.util.MyMapper]; codes [Typemismatch.mapper.mappers[0],typemismatch.mapper.mappers,typemismatch.mappers[0],typemismatch.mappers, Typemismatch]; arguments [Org.springframework.context.support.DefaultMessageSourceResolvable:codes [mapper.mappers[0],mappers[0 ]]; arguments []; Default message [Mappers[0]]; Default message [Failed to convert property value of type ' java.lang.String ' to required type ' java.lang.Class ' for proper Ty ' mappers[0] '; Nested exception is java.lang.IllegalArgumentException:Cannot find class [ Com.programmersupermarket.users.util.MyMapper]] at Org.springframework.boot.bind.PropertiesConfigurationFactory.checkForBindingErrors ( propertiesconfigurationfactory.java:359) at Org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget ( propertiesconfigurationfactory.java:276) at Org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget ( propertiesconfigurationfactory.java:240) at Org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization (configurationpropertiesbindingpostprocessor.java:329) ... More


The other mistake of a problem finally came out

Where did the problem arise? Appeared in my configuration file inside.


Came out in this piece, because my path configuration has been wrong, looked carefully, and modified to run successfully


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.