Exception in org. springframework. beans. factory. BeanDefinitionStoreException, beansexception

Source: Internet
Author: User

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

  

 

Related Article

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.