Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"

简介: 版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/41412595  org.
版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢。 https://blog.csdn.net/testcs_dn/article/details/41412595
 org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'masterDataSource' defined in file [C:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xinghe-mycenter-web\WEB-INF\classes\spring\applicationContext-dbpool-c3p0.xml]: Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'master.jdbc.url' in string value "${master.jdbc.url}"

很明显,项目中使用了c3p0连接池。
而出现此错误的原因是缺少配置文件,严格的说是C3P0从配置文件中找不到名称为“master.jdbc.url”的配置项。
解决办法:
如下图,这是一个Maven Web项目,如果没有对应的目录或文件就创建它。

jdbc.properties文件内容:其实你可以叫其它的名称,但扩展名是不可改变的。
# dataSource related
jdbc.driver.class=com.mysql.jdbc.Driver

master.jdbc.url=jdbc:mysql://192.168.1.127:3306/testcs_dn?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&relaxAutoCommit=true&useServerPreparedStmts=true
master.jdbc.username=abcd
master.jdbc.password=**********
重新发布:最好是Clean,Publish通常也没问题,遇到人品不好的情况就不好说了……


目录
相关文章
|
3月前
|
SQL 搜索推荐 关系型数据库
Mysql报Cause: java.sql.SQLException: Incorrect string value: ‘\xE5\xA4\x96‘...for column username
Mysql报Cause: java.sql.SQLException: Incorrect string value: ‘\xE5\xA4\x96‘...for column username
24 0
|
8月前
|
关系型数据库 MySQL Java
Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
解决方法: 配置H2数据库或者MySQL数据库,其中配置MySQL解决方法如下: 1、添加 MySQL连接驱动的依赖 Maven工程在pom.xml中添加
225 0
|
6月前
|
SQL 数据库
解决Incorrect string value: ‘\xE5\xBC\xA0\xE4\xB8\x89‘ for column ‘name‘ at row 1 SQL Statement的问题~
解决Incorrect string value: ‘\xE5\xBC\xA0\xE4\xB8\x89‘ for column ‘name‘ at row 1 SQL Statement的问题~
169 0
|
9月前
|
XML 关系型数据库 MySQL
Mysql插入emoji表情字符编码错误 Incorrect string value: ‘\xF0\x9F\x98\x84\xF0\x9F...‘ for column ‘comment‘ at r
今天在插入数据时发现emoji表情时数据库报错了,以前从来不会报错的,因为我设计表时从来都是如下设置:
134 0
|
10月前
|
SQL 关系型数据库 MySQL
【问题解决】MySQL5.5 向MySQL数据库中插入汉字时,提示:Incorrect string value: '\Xe7\x8E...' for column 'XXX' at row 1
【问题解决】MySQL5.5 向MySQL数据库中插入汉字时,提示:Incorrect string value: '\Xe7\x8E...' for column 'XXX' at row 1
|
11月前
|
缓存 JSON NoSQL
Map<Integer,Value>放入缓存后取出来变成了Map<String,Value>
Map<Integer,Value>放入缓存后取出来变成了Map<String,Value>
161 0
|
11月前
|
存储 关系型数据库 MySQL
Mysql插入emoji表情报错java.sql.SQLException: Incorrect string value: '\xF0\x9F\x90\xB8'
Mysql插入emoji表情报错java.sql.SQLException: Incorrect string value: '\xF0\x9F\x90\xB8'
235 0
|
关系型数据库 MySQL Python
pymysql.err.DataError: (1366, "Incorrect string value: '\\xC2\\xA0\\xE5\\x89\\xA7\\xE6...' for column 'types' at row 1")怎么解决?
这个错误通常是由于在尝试将一个包含非ASCII字符的字符串插入到MySQL表的一个字符列中,但该列没有设置正确的字符集导致的。 解决方法是要确保将表的字符集设置正确,以便它能够支持插入包含非ASCII字符的字符串。 可以尝试以下方法来解决这个问题:
631 0
|
关系型数据库 MySQL 数据库
pymysql.err.DataError: (1366, "Incorrect string value: '\\xC2\\xB7\\xE6\\x83\\x85' for column 'filmname' at row 1") 是什么原因?
这个错误是由于在向MySQL数据库的'filmname'列插入数据时,数据包含了不能被该列接受的字符或编码。该错误指出了该列中无效的字符或编码的位置。
502 0
|
数据库
Failed to configure a DataSource: url attribute is not specified and no embedded datasource could...
Failed to configure a DataSource: url attribute is not specified and no embedded datasource could...
Failed to configure a DataSource: url attribute is not specified and no embedded datasource could...