Spring integration mybaits connections could not being acquired from the underlying database! exception resolution

Source: Internet
Author: User

<?xml version= "1.0" encoding= "UTF-8"? ><beans xmlns= "Http://www.springframework.org/schema/beans" xmlns:   Xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns:context= "Http://www.springframework.org/schema/context" Xmlns:mvc= "Http://www.springframework.org/schema/mvc" xsi:schemalocation= "Http://www.springframework.org/schema /beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsdhttp://www.springframework.org/schema/ Context Http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/ Schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd "><!--automatically create beans using annotations, set the package where the bean is located-- ><context:component-scan base-package= "Com.leo.dao,com.leo.service"/><!--@Autowired Automatic Assembly <bean class= "Org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>--><!-- Configure Data source--><!--<context:property-placeholder location= "classpath:db.properties"/>--><bean id ="Propertyconfigurer" class = "Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" > < Property name = "Location" value = "com/leo/resources/db.properties"/> </bean><bean id= "DataSource" CLA ss= "Com.mchange.v2.c3p0.ComboPooledDataSource" ><property name= "Driverclass" value= "${driverclass}" >< /property><property name= "Jdbcurl" value= "${url}" ></property><property name= "user" value= "${ Username} "></property><property name=" password "value=" ${password} "></property></bean ><!--Create Sqlsessionfactory--><bean id= "Sqlsessionfactory" class= " Org.mybatis.spring.SqlSessionFactoryBean "><!--specify data source--><property name=" DataSource "ref=" DataSource "/ ><property name= "Typealiasespackage" value= "com.leo.entity" ></property><property name= " Mapperlocations "value=" Classpath*:com/leo/dao/*mapper.xml "/></bean><!--configuration transaction--><bean id=" TransactionManager "Class="Org.springframework.jdbc.datasource.DataSourceTransactionManager "><property name=" datasource "ref=" DataSource "/></bean><!--Map interface--><bean class=" Org.mybatis.spring.mapper.MapperScannerConfigurer "><property name=" Basepackage "value=" Com.leo.dao "/><property name=" Sqlsessionfactorybeanname "value=" Sqlsessionfactory "/></bean></beans>


When I use this sentence to read the data source file, I always can't find

<context:property-placeholder location= "Classpath:db.properties"/>

Into

<bean id = "Propertyconfigurer"  class = " Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer ">    <property  name =" Location "  value =" Com/leo/resources/db.properties "/></bean>
Yes, I don't know why.

Hope to get help, know people can help answer,

Spring integration mybaits connections could not being acquired from the underlying database! exception resolution

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.