报错信息
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at tk.mybatis.spring.mapper.SpringBootBindUtil S p r i n g B o o t 2 B i n d . b i n d ( S p r i n g B o o t B i n d U t i l . j a v a : 129 )   [ m a p p e r − s p r i n g − b o o t − a u t o c o n f i g u r e − 1.2.3. j a r : n a ] a t t k . m y b a t i s . s p r i n g . m a p p e r . S p r i n g B o o t B i n d U t i l . b i n d ( S p r i n g B o o t B i n d U t i l . j a v a : 58 )   [ m a p p e r − s p r i n g − b o o t − a u t o c o n f i g u r e − 1.2.3. j a r : n a ] a t t k . m y b a t i s . s p r i n g . m a p p e r . C l a s s P a t h M a p p e r S c a n n e r . s e t M a p p e r P r o p e r t i e s ( C l a s s P a t h M a p p e r S c a n n e r . j a v a : 48 )   [ m a p p e r − s p r i n g − b o o t − a u t o c o n f i g u r e − 1.2.3. j a r : n a ] a t t k . m y b a t i s . s p r i n g . a n n o t a t i o n . M a p p e r S c a n n e r R e g i s t r a r . r e g i s t e r B e a n D e f i n i t i o n s ( M a p p e r S c a n n e r R e g i s t r a r . j a v a : 33 )   [ m a p p e r − s p r i n g − b o o t − a u t o c o n f i g u r e − 1.2.3. j a r : n a ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . a n n o t a t i o n . C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . l a m b d a SpringBoot2Bind.bind(SpringBootBindUtil.java:129) ~[mapper-spring-boot-autoconfigure-1.2.3.jar:na] at tk.mybatis.spring.mapper.SpringBootBindUtil.bind(SpringBootBindUtil.java:58) ~[mapper-spring-boot-autoconfigure-1.2.3.jar:na] at tk.mybatis.spring.mapper.ClassPathMapperScanner.setMapperProperties(ClassPathMapperScanner.java:48) ~[mapper-spring-boot-autoconfigure-1.2.3.jar:na] at tk.mybatis.spring.annotation.MapperScannerRegistrar.registerBeanDefinitions(MapperScannerRegistrar.java:33) ~[mapper-spring-boot-autoconfigure-1.2.3.jar:na] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda SpringBoot2Bind.bind(SpringBootBindUtil.java:129) [mapperspringbootautoconfigure1.2.3.jar:na]attk.mybatis.spring.mapper.SpringBootBindUtil.bind(SpringBootBindUtil.java:58) [mapperspringbootautoconfigure1.2.3.jar:na]attk.mybatis.spring.mapper.ClassPathMapperScanner.setMapperProperties(ClassPathMapperScanner.java:48) [mapperspringbootautoconfigure1.2.3.jar:na]attk.mybatis.spring.annotation.MapperScannerRegistrar.registerBeanDefinitions(MapperScannerRegistrar.java:33) [mapperspringbootautoconfigure1.2.3.jar:na]atorg.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambdaloadBeanDefinitionsFromRegistrars 1 ( C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . j a v a : 363 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t j a v a . u t i l . L i n k e d H a s h M a p . f o r E a c h ( L i n k e d H a s h M a p . j a v a : 684 )   [ n a : 1.8. 0 1 31 ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . a n n o t a t i o n . C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s F r o m R e g i s t r a r s ( C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . j a v a : 362 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . a n n o t a t i o n . C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s F o r C o n f i g u r a t i o n C l a s s ( C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . j a v a : 145 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . a n n o t a t i o n . C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . l o a d B e a n D e f i n i t i o n s ( C o n f i g u r a t i o n C l a s s B e a n D e f i n i t i o n R e a d e r . j a v a : 117 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . a n n o t a t i o n . C o n f i g u r a t i o n C l a s s P o s t P r o c e s s o r . p r o c e s s C o n f i g B e a n D e f i n i t i o n s ( C o n f i g u r a t i o n C l a s s P o s t P r o c e s s o r . j a v a : 327 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . a n n o t a t i o n . C o n f i g u r a t i o n C l a s s P o s t P r o c e s s o r . p o s t P r o c e s s B e a n D e f i n i t i o n R e g i s t r y ( C o n f i g u r a t i o n C l a s s P o s t P r o c e s s o r . j a v a : 232 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . i n v o k e B e a n D e f i n i t i o n R e g i s t r y P o s t P r o c e s s o r s ( P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . j a v a : 275 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . i n v o k e B e a n F a c t o r y P o s t P r o c e s s o r s ( P o s t P r o c e s s o r R e g i s t r a t i o n D e l e g a t e . j a v a : 95 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . i n v o k e B e a n F a c t o r y P o s t P r o c e s s o r s ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 705 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . c o n t e x t . s u p p o r t . A b s t r a c t A p p l i c a t i o n C o n t e x t . r e f r e s h ( A b s t r a c t A p p l i c a t i o n C o n t e x t . j a v a : 531 )   [ s p r i n g − c o n t e x t − 5.1.15. R E L E A S E . j a r : 5.1.15. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . w e b . s e r v l e t . c o n t e x t . S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . r e f r e s h ( S e r v l e t W e b S e r v e r A p p l i c a t i o n C o n t e x t . j a v a : 141 )   [ s p r i n g − b o o t − 2.1.14. R E L E A S E . j a r : 2.1.14. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h ( S p r i n g A p p l i c a t i o n . j a v a : 744 ) [ s p r i n g − b o o t − 2.1.14. R E L E A S E . j a r : 2.1.14. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r e f r e s h C o n t e x t ( S p r i n g A p p l i c a t i o n . j a v a : 391 ) [ s p r i n g − b o o t − 2.1.14. R E L E A S E . j a r : 2.1.14. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 312 ) [ s p r i n g − b o o t − 2.1.14. R E L E A S E . j a r : 2.1.14. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1215 ) [ s p r i n g − b o o t − 2.1.14. R E L E A S E . j a r : 2.1.14. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b o o t . S p r i n g A p p l i c a t i o n . r u n ( S p r i n g A p p l i c a t i o n . j a v a : 1204 ) [ s p r i n g − b o o t − 2.1.14. R E L E A S E . j a r : 2.1.14. R E L E A S E ] a t c o m . t a n g s i r . u s e r . T a n g U s e r A p p l i c a t i o n . m a i n ( T a n g U s e r A p p l i c a t i o n . j a v a : 12 ) [ c l a s s e s / : n a ] C a u s e d b y : j a v a . l a n g . r e f l e c t . I n v o c a t i o n T a r g e t E x c e p t i o n : n u l l a t s u n . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e 0 ( N a t i v e M e t h o d )   [ n a : 1.8. 0 1 31 ] a t s u n . r e f l e c t . N a t i v e M e t h o d A c c e s s o r I m p l . i n v o k e ( N a t i v e M e t h o d A c c e s s o r I m p l . j a v a : 62 )   [ n a : 1.8. 0 1 31 ] a t s u n . r e f l e c t . D e l e g a t i n g M e t h o d A c c e s s o r I m p l . i n v o k e ( D e l e g a t i n g M e t h o d A c c e s s o r I m p l . j a v a : 43 )   [ n a : 1.8. 0 1 31 ] a t j a v a . l a n g . r e f l e c t . M e t h o d . i n v o k e ( M e t h o d . j a v a : 498 )   [ n a : 1.8. 0 1 31 ] a t t k . m y b a t i s . s p r i n g . m a p p e r . S p r i n g B o o t B i n d U t i l 1(ConfigurationClassBeanDefinitionReader.java:363) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) ~[na:1.8.0_131] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:362) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:145) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.15.RELEASE.jar:5.1.15.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE] at com.tangsir.user.TangUserApplication.main(TangUserApplication.java:12) [classes/:na] Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131] at tk.mybatis.spring.mapper.SpringBootBindUtil 1(ConfigurationClassBeanDefinitionReader.java:363) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atjava.util.LinkedHashMap.forEach(LinkedHashMap.java:684) [na:1.8.0131]atorg.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromRegistrars(ConfigurationClassBeanDefinitionReader.java:362) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:145) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) [springcontext5.1.15.RELEASE.jar:5.1.15.RELEASE]atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [springboot2.1.14.RELEASE.jar:2.1.14.RELEASE]atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)[springboot2.1.14.RELEASE.jar:2.1.14.RELEASE]atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)[springboot2.1.14.RELEASE.jar:2.1.14.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:312)[springboot2.1.14.RELEASE.jar:2.1.14.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1215)[springboot2.1.14.RELEASE.jar:2.1.14.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1204)[springboot2.1.14.RELEASE.jar:2.1.14.RELEASE]atcom.tangsir.user.TangUserApplication.main(TangUserApplication.java:12)[classes/:na]Causedby:java.lang.reflect.InvocationTargetException:nullatsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) [na:1.8.0131]atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [na:1.8.0131]atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [na:1.8.0131]atjava.lang.reflect.Method.invoke(Method.java:498) [na:1.8.0131]attk.mybatis.spring.mapper.SpringBootBindUtilSpringBoot2Bind.bind(SpringBootBindUtil.java:127) ~[mapper-spring-boot-autoconfigure-1.2.3.jar:na]
… 21 common frames omitted
Caused by: java.util.NoSuchElementException: No value bound
at org.springframework.boot.context.properties.bind.BindResult.get(BindResult.java:56) ~[spring-boot-2.1.14.RELEASE.jar:2.1.14.RELEASE]
… 26 common frames omitted

Disconnected from the target VM, address: ‘127.0.0.1:65366’, transport: ‘socket’

Process finished with exit code 1

解决:
在application.properties添加

mapper.identity=MYSQL

在这里插入图片描述

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐