args : [{"ds_0":{refer:"dataSource"}}],
请问这么写格式有错吗
args : [{"ds_0":{refer:"dataSource"}}],
请问这么写格式有错吗
@qq_2b6bbb2b
shardingDataSource : {
factory : "com.tiankong.core.sharding.ShardingFactory#make",
type : "com.alibaba.druid.pool.DruidDataSource",
args : [{"ds_0":{refer:"dataSource"}}],
events : {
create : "init",
depose : "close"
}
}
Exception in thread "main" org.nutz.ioc.IocException: IocBean[shardingDao -> shardingDataSource] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:75)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at com.tiankong.core.DubboStart.main(DubboStart.java:25)
2017-11-28 17:34:33,108 org.nutz.ioc.impl.ScopeContext.remove(ScopeContext.java:84) DEBUG - Remove object 'shardingDao' from [app]
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:18)
at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:72)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
... 6 more
make方法返回的是个接口 datasource、