-
Notifications
You must be signed in to change notification settings - Fork 34
Description
问题:jdbc版本的demo代码配置有问题;
问题描述:
1.applicationContext_db_mysql.xml中的lcnDataSourceProxy对象中并没有对应的dataSource成员变量,强制赋值,容器启动会提示(org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource' of bean class [com.codingapi.tx.datasource.relational.LCNTransactionDataSource]: Bean property 'dataSource' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?)
2.jdbcTemplate的dataSource成员变量赋值类型有问题,启动提示(java.lang.IllegalStateException: Cannot convert value of type 'com.codingapi.tx.datasource.relational.LCNTransactionDataSource' to required type 'javax.sql.DataSource' for property 'dataSource': no matching editors or conversion strategy found)
开发工具:intellij idea
开发环境:windows7
jdk版本:1.8