Caused by: org.nutz.ioc.IocException: more than one bean for type=[interface com.ifm.sys.dao.UserDao], names=[Ljava.lang.String;@3e7baed5 FAIL to create Ioc Bean name=[userServiceImpl]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:147)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:204)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
at org.nutz.ioc.impl.NutIoc.getByType(NutIoc.java:355)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:42)
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:135)
... 30 more
下面是我的代码:
@IocBean
public class UserDaoImpl extends BaseDao implements UserDao {
@Override
public IfmUser fetchUser(String userid) {
return dao.fetch(IfmUser.class, Cnd.where("userid", "=", userid));
}
@Override
public List<Record> qryRolesByid(String roleid) {
// TODO Auto-generated method stub
return null;
}
}
-------------serivce有两个地方调用
@IocBean
public class UserServiceImpl extends BaseService implements UserService {
@Inject
private UserDao userDao;
@Override
public CallBackBean qryuserList(String json) {
Cnds cnds = Json.fromJson(Cnds.class, json);
//cnds = SqlUtils.apCnd(cnds);
List<Record> res = userDao.qryuserList(cnds);
int count = userDao.countuserList(cnds);
return joinformateJson(json, "success", count + "", res);
}
}