使用nutz做单元测试
utils : {
type : 'com.ifs.infra.tools.FileUtils',
fields : {
sc : {app:'$servlet'} // 将 ServletContext 对象注入 MyUtils
}
},
启动报错:
Caused by: org.nutz.ioc.IocException: create ioc bean fail name=utils ioc define:
{
"type" :"com.ifs.infra.tools.FileUtils",
"singleton" :true,
"args" :[],
"fields" :[{
"name" :"sc",
"value" :{
"type" :"normal",
"value" :{
"app" :{
"type" :"normal",
"value" :"$servlet"
}
}
},
"optional" :false
}],
"scope" :"app"
}
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:132)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:194)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:31)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:123)
... 67 more
5 回复
添加回复
请先登陆