org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType

SpringBoot整合阿里巴巴连接池druid(德鲁伊)报错

错误信息如下:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘dataSource’: Unsatisfied dependency expressed through field ‘basicProperties’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor A u t o w i r e d F i e l d E l e m e n t . i n j e c t ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 598 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . a n n o t a t i o n . I n j e c t i o n M e t a d a t a . i n j e c t ( I n j e c t i o n M e t a d a t a . j a v a : 90 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . a n n o t a t i o n . A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . p o s t P r o c e s s P r o p e r t i e s ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 376 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p o p u l a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1402 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d o C r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 591 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 514 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . l a m b d a AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:598) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1402) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:591) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:598) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1402) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:591) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdadoGetBean 0 ( A b s t r a c t B e a n F a c t o r y . j a v a : 321 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 226 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 319 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 199 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . p r e I n s t a n t i a t e S i n g l e t o n s ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 863 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 . f i n i s h B e a n F a c t o r y I n i t i a l i z a t i o n ( 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 : 878 )   [ s p r i n g − c o n t e x t − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 : 550 )   [ s p r i n g − c o n t e x t − 5.1.17. R E L E A S E . j a r : 5.1.17. 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.16. R E L E A S E . j a r : 2.1.16. 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.16. R E L E A S E . j a r : 2.1.16. 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.16. R E L E A S E . j a r : 2.1.16. 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.16. R E L E A S E . j a r : 2.1.16. 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.16. R E L E A S E . j a r : 2.1.16. 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.16. R E L E A S E . j a r : 2.1.16. R E L E A S E ] a t c o m . k i n g . s h i r o . T e s t S h i r o A p p l i c a t i o n . m a i n ( T e s t S h i r o A p p l i c a t i o n . j a v a : 10 ) [ c l a s s e s / : n a ] C a u s e d b y : o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . B e a n C r e a t i o n E x c e p t i o n : E r r o r c r e a t i n g b e a n w i t h n a m e ′ s p r i n g . d a t a s o u r c e − o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . j d b c . D a t a S o u r c e P r o p e r t i e s ′ : I n s t a n t i a t i o n o f b e a n f a i l e d ; n e s t e d e x c e p t i o n i s o r g . s p r i n g f r a m e w o r k . b e a n s . B e a n I n s t a n t i a t i o n E x c e p t i o n : F a i l e d t o i n s t a n t i a t e [ o r g . s p r i n g f r a m e w o r k . b o o t . a u t o c o n f i g u r e . j d b c . D a t a S o u r c e P r o p e r t i e s ] : C o n s t r u c t o r t h r e w e x c e p t i o n ; n e s t e d e x c e p t i o n i s j a v a . l a n g . N o C l a s s D e f F o u n d E r r o r : o r g / s p r i n g f r a m e w o r k / j d b c / d a t a s o u r c e / e m b e d d e d / E m b e d d e d D a t a b a s e T y p e a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . i n s t a n t i a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1300 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n I n s t a n c e ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1195 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . d o C r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 554 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . c r e a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 514 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . l a m b d a 0(AbstractBeanFactory.java:321) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:863) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE] at com.king.shiro.TestShiroApplication.main(TestShiroApplication.java:10) [classes/:na] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1300) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda 0(AbstractBeanFactory.java:321) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:863) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) [springcontext5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) [springcontext5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) [springboot2.1.16.RELEASE.jar:2.1.16.RELEASE]atorg.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)[springboot2.1.16.RELEASE.jar:2.1.16.RELEASE]atorg.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)[springboot2.1.16.RELEASE.jar:2.1.16.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:312)[springboot2.1.16.RELEASE.jar:2.1.16.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1215)[springboot2.1.16.RELEASE.jar:2.1.16.RELEASE]atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1204)[springboot2.1.16.RELEASE.jar:2.1.16.RELEASE]atcom.king.shiro.TestShiroApplication.main(TestShiroApplication.java:10)[classes/:na]Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithnamespring.datasourceorg.springframework.boot.autoconfigure.jdbc.DataSourceProperties:Instantiationofbeanfailed;nestedexceptionisorg.springframework.beans.BeanInstantiationException:Failedtoinstantiate[org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]:Constructorthrewexception;nestedexceptionisjava.lang.NoClassDefFoundError:org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseTypeatorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1300) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:554) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.lambdadoGetBean 0 ( A b s t r a c t B e a n F a c t o r y . j a v a : 321 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . D e f a u l t S i n g l e t o n B e a n R e g i s t r y . g e t S i n g l e t o n ( D e f a u l t S i n g l e t o n B e a n R e g i s t r y . j a v a : 226 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . d o G e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 319 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . A b s t r a c t B e a n F a c t o r y . g e t B e a n ( A b s t r a c t B e a n F a c t o r y . j a v a : 199 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . c o n f i g . D e p e n d e n c y D e s c r i p t o r . r e s o l v e C a n d i d a t e ( D e p e n d e n c y D e s c r i p t o r . j a v a : 277 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . d o R e s o l v e D e p e n d e n c y ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 1273 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . s u p p o r t . D e f a u l t L i s t a b l e B e a n F a c t o r y . r e s o l v e D e p e n d e n c y ( D e f a u l t L i s t a b l e B e a n F a c t o r y . j a v a : 1193 )   [ s p r i n g − b e a n s − 5.1.17. R E L E A S E . j a r : 5.1.17. 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 e a n s . f a c t o r y . a n n o t a t i o n . A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r 0(AbstractBeanFactory.java:321) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1273) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1193) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor 0(AbstractBeanFactory.java:321) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1273) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1193) [springbeans5.1.17.RELEASE.jar:5.1.17.RELEASE]atorg.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessorAutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:595) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE]
… 19 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1292) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE]
… 30 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseType
at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.(EmbeddedDatabaseConnection.java:51) ~[spring-boot-2.1.16.RELEASE.jar:2.1.16.RELEASE]
at org.springframework.boot.autoconfigure.jdbc.DataSourceProperties.(DataSourceProperties.java:152) ~[spring-boot-autoconfigure-2.1.16.RELEASE.jar:2.1.16.RELEASE]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_161]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_161]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172) ~[spring-beans-5.1.17.RELEASE.jar:5.1.17.RELEASE]
… 32 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
… 39 common frames omitted

解决办法如下:

在 pom.xml文件引入依赖:

<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
</dependency>
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: org.springframework.jdbc.datasource.embedded.embeddeddatabasetypeSpring框架中的一个类,用于表示嵌入式数据库的类型。嵌入式数据库是指在应用程序中嵌入的数据库,不需要单独安装和配置,可以直接使用。Spring框架提供了多种嵌入式数据库的支持,如HSQL、H2、Derby等。embeddeddatabasetype表示嵌入式数据库的类型,可以是HSQL、H2、Derby等。 ### 回答2: org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseTypeSpring框架提供的一个枚举类型,用于指定嵌入式数据库的类型。嵌入式数据库就是指部署在应用程序中的数据库,不需要单独安装和配置,可以方便地进行单元测试和开发调试。 该枚举类型包含以下几种嵌入式数据库类型: 1. H2:一种轻量级的、开源的、关系型数据库,支持内存数据库和磁盘数据库。 2. HSQL:一种完全嵌入式的、开源的、关系型数据库,可以运行在内存中或磁盘上。 3. Derby:一种基于Java的、开源的、关系型数据库,可以运行在内存中或磁盘上。 枚举类型中每一种嵌入式数据库类型都对应了一个具体的类,如org.springframework.jdbc.datasource.embedded.H2DatabaseTypeorg.springframework.jdbc.datasource.embedded.HsqlDatabaseTypeorg.springframework.jdbc.datasource.embedded.DerbyDatabaseType。这些类都实现了EmbeddedDatabaseType接口,该接口定义了获取数据库名称、驱动类名称、连接URL以及是否支持嵌入式模式等方法。 在使用Spring框架进行单元测试时,可以使用Spring提供的嵌入式数据库来代替真实的数据库,从而加快测试的速度和提高测试的灵活性。通过指定org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType枚举类型,可以选择具体的嵌入式数据库类型,启动嵌入式数据库,执行SQL语句,验证结果等。这样可以方便地进行单元测试和开发调试,同时还能够保证数据的隔离性和独立性,不会影响到真实的数据库。 总之,org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseTypeSpring框架中嵌入式数据库类型的枚举类型,提供了方便的单元测试和开发调试功能,是Spring框架中重要的一个组成部分。 ### 回答3: org.springframework.jdbc.datasource.embedded.embeddeddatabasetypeSpring Framework中一个用于嵌入式数据库类型的枚举类。这个类可以用来指定在应用程序中使用的嵌入式数据库的类型。嵌入式数据库是一种可以在应用程序中直接嵌入和运行的数据库,与传统的客户端-服务器模型不同。嵌入式数据库在应用程序开发中很常见,因为它们能够快速启动/关闭,没有额外的配置,省去了连接管理和通信开销,可以简化应用程序的部署和维护等方面的问题。 EmbeddedDatabaseType包含了四种嵌入式数据库类型:HSQL,H2,DERBY和sqlite。这些嵌入式数据库都具有轻量级、高性能、可扩展、易用等特点。 HSQL是HyperSQL的缩写,是一种Java编写的内存数据库,它支持SQL-92标准和JDBC API。它可以存储在磁盘上,但可以在内存中进行大部分操作。HSQL是一种纯Java开发的嵌入式数据库,它可以与任何Java开发环境搭配使用。 H2是Java编写的开源数据库。H2是一种快速、可扩展、支持高级SQL语句的嵌入式数据库,它支持JDBC API,可以与任何Java开发环境搭配使用。H2的特点包括高速执行、小巧轻便、易扩展等。 DERBY又称Java DB,是一个基于Java平台开发的嵌入式数据库。它是一个纯Java的嵌入式数据库,为Java应用程序提供持久化存储和查询功能。DERBY支持JDBC API,可以与任何Java开发环境搭配使用。 SQLite是一个轻量级嵌入式数据库管理系统,它占用的资源相对较小,在资源有限的环境下,极其适合使用。SQLite不需要单独的服务进程或服务器,它将整个数据库存储在一个单一的文件中,在JDBC应用程序中调用,可以与任何Java开发环境搭配使用。 在应用程序中使用org.springframework.jdbc.datasource.embedded.embeddeddatabasetype可以轻松地在类路径中查找嵌入式数据库实现的具体类型,在使用时指定嵌入式数据库类型即可。它只需要几行配置即可实现对嵌入式数据库的使用,大大简化了应用程序的开发和部署。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值