Spring和Mybatis整合时无法读取properties的处理方案
2018-02-26 23:03
375 查看
版本:Spring:3.1.4、Mybatis:3.1.1、Mybatis-Spring:1.1.1;背景:config.properties配置文件信息Properties代码
##数据库(mysql|mssql|oracle...)
environment=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/portal?useUnicode=true&characterEncoding=utf8
jdbc.user=root
jdbc.password=root
#初始化连接(根据实际访问量设置大小)
jdbc.initialSize=10
#最大空闲连接(根据实际访问量设置大小)
jdbc.maxIdle=50
#最小空闲连接(根据实际访问量设置大小)
jdbc.minIdle=10
#最大连接数量(根据实际访问量设置大小)
jdbc.maxActive=200
Spring配置信息(截取部分)Xml代码
<context:property-placeholder location="classpath:config.properties" />
<!--创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.user}"/>
<property name="password" value="${jdbc.password}"/>
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="maxIdle" value="${jdbc.maxIdle}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="removeAbandoned" value="true"/>
<property name="removeAbandonedTimeout" value="120"/>
<property name="maxWait" value="3000"/>
</bean>
<!-- 创建SqlSessionFactory,同时指定数据源 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations" value="classpath*:com.anly.portal.*.mapper/*Mapper.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 此处扫描的是Mapper接口 -->
<property name="basePackage" value="com.anly.portal.*.mapper"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
此时,启动会报异常,${jdbc.driver}这样的表达式获取不到properties里面的值,因为MapperScannerConigurer实际是在解析加载bean定义阶段的,这个时候要是设置sqlSessionFactory的话,会导致提前初始化一些类,这个时候,PropertyPlaceholderConfigurer还没来得及替换定义中的变量,导致把表达式当作字符串复制了,解决的办法如下: 方法一:修改<property name="sqlSessionFactory" ref="sqlSessionFactory"/>为<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>原理:使用sqlSessionFactoryBeanName注入,不会立即初始化sqlSessionFactory, 所以不会引发提前初始化问题。 方法二:直接删掉<property name="sqlSessionFactory" ref="sqlSessionFactory"/>注意:在没有配置这一行时,必须配置一个以sqlSessionFactory命名的org.mybatis.spring.SqlSessionFactoryBean。
一个完成的配置示例:[html] view plain copy<?xml version="1.0" encoding="UTF-8"?>
<!--本示例采用DBCP连接池,应预先把DBCP的jar包复制到工程的lib目录下。 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 属性文件 -->
<context:property-placeholder location="classpath:oracle.properties" />
<!-- 数据源 p:initialSize="20"
p:maxActive="100"
p:maxIdle="30"
p:maxWait="1000"
p:poolPreparedStatements="true"
destroy-method="close"-->
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}"
p:defaultAutoCommit="true"
p:poolPreparedStatements="true">
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- dataSource属性指定要用到的连接池 -->
<property name="dataSource" ref="dataSource"/>
<!-- configLocation属性指定mybatis的核心配置文件 -->
<property name="configLocation" value="classpath:Configuration.xml"/>
<!-- 所有配置的mapper文件 -->
<property name="mapperLocations" value="classpath*:com/winit/mapper/*.xml"/>
</bean>
<!-- 注入mybatis的数据库操作接口dao到spring容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.winit.dao"/>
</bean>
<!-- 扫描com这个包里的所有类,把里面配上相应注解的类全都放在容器中进行管理(如果这里不加的话,单元测试会获取不到) -->
<context:component-scan base-package="com.winit"/>
</beans>
版本:Spring:3.1.4、Mybatis:3.1.1、Mybatis-Spring:1.1.1;背景:config.properties配置文件信息Properties代码
##数据库(mysql|mssql|oracle...)
environment=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/portal?useUnicode=true&characterEncoding=utf8
jdbc.user=root
jdbc.password=root
#初始化连接(根据实际访问量设置大小)
jdbc.initialSize=10
#最大空闲连接(根据实际访问量设置大小)
jdbc.maxIdle=50
#最小空闲连接(根据实际访问量设置大小)
jdbc.minIdle=10
#最大连接数量(根据实际访问量设置大小)
jdbc.maxActive=200
Spring配置信息(截取部分)Xml代码
<context:property-placeholder location="classpath:config.properties" />
<!--创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.user}"/>
<property name="password" value="${jdbc.password}"/>
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="maxIdle" value="${jdbc.maxIdle}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="removeAbandoned" value="true"/>
<property name="removeAbandonedTimeout" value="120"/>
<property name="maxWait" value="3000"/>
</bean>
<!-- 创建SqlSessionFactory,同时指定数据源 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations" value="classpath*:com.anly.portal.*.mapper/*Mapper.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 此处扫描的是Mapper接口 -->
<property name="basePackage" value="com.anly.portal.*.mapper"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
此时,启动会报异常,${jdbc.driver}这样的表达式获取不到properties里面的值,因为MapperScannerConigurer实际是在解析加载bean定义阶段的,这个时候要是设置sqlSessionFactory的话,会导致提前初始化一些类,这个时候,PropertyPlaceholderConfigurer还没来得及替换定义中的变量,导致把表达式当作字符串复制了,解决的办法如下: 方法一:修改<property name="sqlSessionFactory" ref="sqlSessionFactory"/>为<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>原理:使用sqlSessionFactoryBeanName注入,不会立即初始化sqlSessionFactory, 所以不会引发提前初始化问题。 方法二:直接删掉<property name="sqlSessionFactory" ref="sqlSessionFactory"/>注意:在没有配置这一行时,必须配置一个以sqlSessionFactory命名的org.mybatis.spring.SqlSessionFactoryBean。
一个完成的配置示例:[html] view plain copy<?xml version="1.0" encoding="UTF-8"?>
<!--本示例采用DBCP连接池,应预先把DBCP的jar包复制到工程的lib目录下。 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 属性文件 -->
<context:property-placeholder location="classpath:oracle.properties" />
<!-- 数据源 p:initialSize="20"
p:maxActive="100"
p:maxIdle="30"
p:maxWait="1000"
p:poolPreparedStatements="true"
destroy-method="close"-->
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}"
p:defaultAutoCommit="true"
p:poolPreparedStatements="true">
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- dataSource属性指定要用到的连接池 -->
<property name="dataSource" ref="dataSource"/>
<!-- configLocation属性指定mybatis的核心配置文件 -->
<property name="configLocation" value="classpath:Configuration.xml"/>
<!-- 所有配置的mapper文件 -->
<property name="mapperLocations" value="classpath*:com/winit/mapper/*.xml"/>
</bean>
<!-- 注入mybatis的数据库操作接口dao到spring容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.winit.dao"/>
</bean>
<!-- 扫描com这个包里的所有类,把里面配上相应注解的类全都放在容器中进行管理(如果这里不加的话,单元测试会获取不到) -->
<context:component-scan base-package="com.winit"/>
</beans>
##数据库(mysql|mssql|oracle...)
environment=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/portal?useUnicode=true&characterEncoding=utf8
jdbc.user=root
jdbc.password=root
#初始化连接(根据实际访问量设置大小)
jdbc.initialSize=10
#最大空闲连接(根据实际访问量设置大小)
jdbc.maxIdle=50
#最小空闲连接(根据实际访问量设置大小)
jdbc.minIdle=10
#最大连接数量(根据实际访问量设置大小)
jdbc.maxActive=200
Spring配置信息(截取部分)Xml代码
<context:property-placeholder location="classpath:config.properties" />
<!--创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.user}"/>
<property name="password" value="${jdbc.password}"/>
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="maxIdle" value="${jdbc.maxIdle}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="removeAbandoned" value="true"/>
<property name="removeAbandonedTimeout" value="120"/>
<property name="maxWait" value="3000"/>
</bean>
<!-- 创建SqlSessionFactory,同时指定数据源 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations" value="classpath*:com.anly.portal.*.mapper/*Mapper.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 此处扫描的是Mapper接口 -->
<property name="basePackage" value="com.anly.portal.*.mapper"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
此时,启动会报异常,${jdbc.driver}这样的表达式获取不到properties里面的值,因为MapperScannerConigurer实际是在解析加载bean定义阶段的,这个时候要是设置sqlSessionFactory的话,会导致提前初始化一些类,这个时候,PropertyPlaceholderConfigurer还没来得及替换定义中的变量,导致把表达式当作字符串复制了,解决的办法如下: 方法一:修改<property name="sqlSessionFactory" ref="sqlSessionFactory"/>为<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>原理:使用sqlSessionFactoryBeanName注入,不会立即初始化sqlSessionFactory, 所以不会引发提前初始化问题。 方法二:直接删掉<property name="sqlSessionFactory" ref="sqlSessionFactory"/>注意:在没有配置这一行时,必须配置一个以sqlSessionFactory命名的org.mybatis.spring.SqlSessionFactoryBean。
一个完成的配置示例:[html] view plain copy<?xml version="1.0" encoding="UTF-8"?>
<!--本示例采用DBCP连接池,应预先把DBCP的jar包复制到工程的lib目录下。 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 属性文件 -->
<context:property-placeholder location="classpath:oracle.properties" />
<!-- 数据源 p:initialSize="20"
p:maxActive="100"
p:maxIdle="30"
p:maxWait="1000"
p:poolPreparedStatements="true"
destroy-method="close"-->
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}"
p:defaultAutoCommit="true"
p:poolPreparedStatements="true">
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- dataSource属性指定要用到的连接池 -->
<property name="dataSource" ref="dataSource"/>
<!-- configLocation属性指定mybatis的核心配置文件 -->
<property name="configLocation" value="classpath:Configuration.xml"/>
<!-- 所有配置的mapper文件 -->
<property name="mapperLocations" value="classpath*:com/winit/mapper/*.xml"/>
</bean>
<!-- 注入mybatis的数据库操作接口dao到spring容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.winit.dao"/>
</bean>
<!-- 扫描com这个包里的所有类,把里面配上相应注解的类全都放在容器中进行管理(如果这里不加的话,单元测试会获取不到) -->
<context:component-scan base-package="com.winit"/>
</beans>
版本:Spring:3.1.4、Mybatis:3.1.1、Mybatis-Spring:1.1.1;背景:config.properties配置文件信息Properties代码
##数据库(mysql|mssql|oracle...)
environment=mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/portal?useUnicode=true&characterEncoding=utf8
jdbc.user=root
jdbc.password=root
#初始化连接(根据实际访问量设置大小)
jdbc.initialSize=10
#最大空闲连接(根据实际访问量设置大小)
jdbc.maxIdle=50
#最小空闲连接(根据实际访问量设置大小)
jdbc.minIdle=10
#最大连接数量(根据实际访问量设置大小)
jdbc.maxActive=200
Spring配置信息(截取部分)Xml代码
<context:property-placeholder location="classpath:config.properties" />
<!--创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.user}"/>
<property name="password" value="${jdbc.password}"/>
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="maxIdle" value="${jdbc.maxIdle}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="removeAbandoned" value="true"/>
<property name="removeAbandonedTimeout" value="120"/>
<property name="maxWait" value="3000"/>
</bean>
<!-- 创建SqlSessionFactory,同时指定数据源 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis-config.xml"/>
<property name="mapperLocations" value="classpath*:com.anly.portal.*.mapper/*Mapper.xml" />
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 此处扫描的是Mapper接口 -->
<property name="basePackage" value="com.anly.portal.*.mapper"/>
<property name="sqlSessionFactory" ref="sqlSessionFactory"/>
</bean>
此时,启动会报异常,${jdbc.driver}这样的表达式获取不到properties里面的值,因为MapperScannerConigurer实际是在解析加载bean定义阶段的,这个时候要是设置sqlSessionFactory的话,会导致提前初始化一些类,这个时候,PropertyPlaceholderConfigurer还没来得及替换定义中的变量,导致把表达式当作字符串复制了,解决的办法如下: 方法一:修改<property name="sqlSessionFactory" ref="sqlSessionFactory"/>为<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>原理:使用sqlSessionFactoryBeanName注入,不会立即初始化sqlSessionFactory, 所以不会引发提前初始化问题。 方法二:直接删掉<property name="sqlSessionFactory" ref="sqlSessionFactory"/>注意:在没有配置这一行时,必须配置一个以sqlSessionFactory命名的org.mybatis.spring.SqlSessionFactoryBean。
一个完成的配置示例:[html] view plain copy<?xml version="1.0" encoding="UTF-8"?>
<!--本示例采用DBCP连接池,应预先把DBCP的jar包复制到工程的lib目录下。 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- 属性文件 -->
<context:property-placeholder location="classpath:oracle.properties" />
<!-- 数据源 p:initialSize="20"
p:maxActive="100"
p:maxIdle="30"
p:maxWait="1000"
p:poolPreparedStatements="true"
destroy-method="close"-->
<bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource"
p:driverClassName="${jdbc.driverClassName}"
p:url="${jdbc.url}"
p:username="${jdbc.username}"
p:password="${jdbc.password}"
p:defaultAutoCommit="true"
p:poolPreparedStatements="true">
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- sqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- dataSource属性指定要用到的连接池 -->
<property name="dataSource" ref="dataSource"/>
<!-- configLocation属性指定mybatis的核心配置文件 -->
<property name="configLocation" value="classpath:Configuration.xml"/>
<!-- 所有配置的mapper文件 -->
<property name="mapperLocations" value="classpath*:com/winit/mapper/*.xml"/>
</bean>
<!-- 注入mybatis的数据库操作接口dao到spring容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.winit.dao"/>
</bean>
<!-- 扫描com这个包里的所有类,把里面配上相应注解的类全都放在容器中进行管理(如果这里不加的话,单元测试会获取不到) -->
<context:component-scan base-package="com.winit"/>
</beans>
相关文章推荐
- Spring和Mybatis整合时无法读取properties的处理方案
- Spring和Mybatis整合时无法读取properties的处理方案
- Spring和Mybatis整合时无法读取properties的处理方案
- Spring和Mybatis整合时无法读取properties的处理方案
- Spring和Mybatis整合时无法读取properties的处理方案
- Spring和Mybatis整合时无法读取properties的处理方案
- Spring和Mybatis整合时无法读取properties的处理方案
- spring+mybatis整合时占位符无法读取jdbc.properties的问题
- Spring SpringMvc 3.0 + MyBatis 整合--补充关于.properties文件的读取
- 关于Spring与mybatis整合无法读取配置文件的问题
- Spring整合myBatis时无法读取placeholder的问题解决
- mybatis与spring整合时读取properties问题的解决
- Spring SpringMvc 3.0 + MyBatis 整合--补充关于.properties文件的读取
- mybatis3.0x升级整合spring问题(读取不到properties文件属性)
- spring+mybatis+druid无法读取jdbc.properties属性导致datasource加载失败
- spring mybatis整合读取配置文件
- spring-mybatis整合异常处理
- MyBatis+Spring整合方案
- 关于spring整合后无法解析properties占位符的问题
- spring无法读取properties文件数据