DaoUp 方式获取 dao的时候 properties 文件中url前缀 spring.url=url 老项目前缀不能动
问答
DaoUp 方式获取 dao的时候 properties 文件中url前缀 spring.url=url 老项目前缀不能动
标签:
无
12 回复
DaoUp.me().setDataSource(new PropertiesProxy("xxx.properties").make(DruidDataSource.class, "spring."));
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=
spring.datasource.username=
spring.datasource.password=
使用 DaoUp.me().setDataSource(new PropertiesProxy("application.properties").make(DruidDataSource.class, "spring.datasource.")); 这个并不行
java.lang.RuntimeException: java.lang.NoSuchFieldException: Can NOT find field [type] in class [com.alibaba.druid.pool.DruidDataSource] and it's parents classes
at org.nutz.lang.Lang.wrapThrow(Lang.java:185)
at org.nutz.lang.Mirror.getInjecting(Mirror.java:1068)
at org.nutz.ioc.impl.PropertiesProxy.make(PropertiesProxy.java:375)
at com.ybej.user.controller.NutzDaoTest.main(NutzDaoTest.java:12)
Caused by: java.lang.NoSuchFieldException: Can NOT find field [type] in class [com.alibaba.druid.pool.DruidDataSource] and it's parents classes
at org.nutz.lang.Mirror.getField(Mirror.java:489)
at org.nutz.lang.Mirror.getInjecting(Mirror.java:1059)
... 2 more
添加回复
请先登陆