1、异常信息:org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration]; nested exception is java.io.FileNotFoundException: class path resource [com/alibaba/druid/spring/boot/autoconfigure/stat/DruidSpringAopConfiguration.class] cannot be opened because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:311) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:600) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.access
800
(
C
o
n
f
i
g
u
r
a
t
i
o
n
C
l
a
s
s
P
a
r
s
e
r
.
j
a
v
a
:
111
)
[
s
p
r
i
n
g
−
c
o
n
t
e
x
t
−
5.2.12.
R
E
L
E
A
S
E
.
j
a
r
:
5.2.12.
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
a
r
s
e
r
800(ConfigurationClassParser.java:111) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at org.springframework.context.annotation.ConfigurationClassParser
800(ConfigurationClassParser.java:111) [spring−context−5.2.12.RELEASE.jar:5.2.12.RELEASE]atorg.springframework.context.annotation.ConfigurationClassParserDeferredImportSelectorGroupingHandler.lambda$processGroupImports
1
(
C
o
n
f
i
g
u
r
a
t
i
o
n
C
l
a
s
s
P
a
r
s
e
r
.
j
a
v
a
:
812
)
[
s
p
r
i
n
g
−
c
o
n
t
e
x
t
−
5.2.12.
R
E
L
E
A
S
E
.
j
a
r
:
5.2.12.
R
E
L
E
A
S
E
]
a
t
j
a
v
a
.
u
t
i
l
.
A
r
r
a
y
L
i
s
t
.
f
o
r
E
a
c
h
(
A
r
r
a
y
L
i
s
t
.
j
a
v
a
:
1257
)
[
n
a
:
1.8.
0
2
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
P
a
r
s
e
r
1(ConfigurationClassParser.java:812) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE] at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_231] at org.springframework.context.annotation.ConfigurationClassParser
1(ConfigurationClassParser.java:812) [spring−context−5.2.12.RELEASE.jar:5.2.12.RELEASE]atjava.util.ArrayList.forEach(ArrayList.java:1257) [na:1.8.0231]atorg.springframework.context.annotation.ConfigurationClassParserDeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:809) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:780) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:319) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:96) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.7.RELEASE.jar:2.3.7.RELEASE]
2、这次排查发现是jar版本不对:
a、出问题的版本为
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.0</version>
</dependency>
b、修改后的版本为
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.9</version>
</dependency>