eclipse 代码生成报错运行方式:java application 添加 -i dic_country -p cn.wizzer.modules.back.sys -u /private/sys 参数
code.json
var ioc={
dataSource : {
type : "org.nutz.dao.impl.SimpleDataSource",
fields : {
url : "jdbc:mysql://121*****.120:3306/***",
username : "****",
password : "123456"
}
},
loader:{
//根据实体生成代码
//type:'cn.enilu.common.code.EntityDescLoader'
//根据表结构生成代码
type:'cn.enilu.common.code.TableDescLoader'
}
}
Exception in thread "main" org.nutz.ioc.IocException: [dataSource] # FAIL to create Ioc Bean name=[dataSource]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:265)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:150)
at cn.enilu.common.code.TableDescLoader.loadTables(TableDescLoader.java:35)
at cn.enilu.common.code.Generator.main(Generator.java:154)
Caused by: java.lang.RuntimeException: Fail to eval Injector for field: 'url'
at org.nutz.lang.Lang.wrapThrow(Lang.java:136)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:128)
... 5 more
Caused by: java.lang.RuntimeException: java.lang.NoSuchFieldException: Can NOT find field [url] in class [org.nutz.dao.impl.SimpleDataSource] and it's parents classes
at org.nutz.lang.Lang.wrapThrow(Lang.java:153)
at org.nutz.lang.Mirror.getInjecting(Mirror.java:1048)
at org.nutz.ioc.weaver.FieldInjector.create(FieldInjector.java:18)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:125)
... 5 more
Caused by: java.lang.NoSuchFieldException: Can NOT find field [url] in class [org.nutz.dao.impl.SimpleDataSource] and it's parents classes
at org.nutz.lang.Mirror.getField(Mirror.java:476)
at org.nutz.lang.Mirror.getInjecting(Mirror.java:1039)
... 7 more