Exception in org. springframework. beans. factory. BeanDefinitionStoreException, beansexception
1. the following error message is displayed:
18:01:11, 322 [localhost-startStop-1] [org. springframework. web. context. ContextLoader]-[ERROR]Context initialization failed
Org. springframework. beans. factory.BeanDefinitionStoreException:
Invalid bean definition with name 'datasource 'defined in file[C: \ Users \ Aaron \ workspace \ HT \ target \ classes \ spring \ applicationContext. xml]:
Cocould not resolve placeholder 'jdbc. driver 'in string value "$ {jdbc. driver }";
Nested exception is java. lang.IllegalArgumentException:
Cocould not resolve placeholder 'jdbc. driver 'in string value "$ {jdbc. driver }"
2. Chinese Translation of exception information:
Context initialization failed:
Environment initialization failed
BeanDefinitionStoreException:
This is an exception object: java bean definition, injection exception
Invalid bean definition with name 'datasource 'defined in file:
Invalid java bean definition. An error occurs when the file C: \ Users \ Aaron \ workspace \ HT \ target \ classes \ spring \ applicationContext. xml is used to define properties for the dataSourece class:
Cocould not resolve placeholder 'jdbc. driver 'in string value "$ {jdbc. driver }";
The placeholder 'jdbc. driver 'in string value "$ {jdbc. driver}" cannot be parsed }";
IllegalArgumentException
Invalid parameter exception
3. Search Error
3.1 The following configurations are available in applicationContext. xml:
<Bean id = "dataSource" class = "com. zaxxer. hikari. HikariDataSource">
<Property name = "driverClassName" value = "$ {Jdbc. driver} "/>
3.2 has the following configuration in db-mysql.properties:
Jdbc. driverClassName= Com. mysql. jdbc. Driver
The variable of 3.3 value is namedJdbc. driverBut what is configured in properties isJdbc. driverClassName
4. Solution
The modify db-mysql.properties file is as follows:
Jdbc. driver= Com. mysql. jdbc. Driver