<?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