首页 > 代码库 > spring整合mybaits时Connections could not be acquired from the underlying database!异常解决
spring整合mybaits时Connections could not be acquired from the underlying database!异常解决
<?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.xsd http://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"> <!-- 使用注解自动创建bean,设置bean所在的包 --> <context:component-scan base-package="com.leo.dao,com.leo.service" /> <!-- @Autowired自动装配 <bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/> --> <!-- 配置数据源 --> <!-- <context:property-placeholder location="classpath:db.properties"/> --> <bean id = "propertyConfigurer" class = "org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" > <property name ="location" value =http://www.mamicode.com/"com/leo/resources/db.properties"/>>
当我使用这句读取数据源文件时,就总是找不到
<context:property-placeholder location="classpath:db.properties"/>
换成
<bean id = "propertyConfigurer" class = "org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" > <property name ="location" value =http://www.mamicode.com/"com/leo/resources/db.properties"/>>就可以,我也不知道为什么?希望可以获得帮助,知道的人可以帮忙解答一下,
spring整合mybaits时Connections could not be acquired from the underlying database!异常解决
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。