NutzCN Logo
问答 IOC none ioc bean match class
发布于 12天前 作者 qq_43bc7d85 82 次浏览 复制 上一个帖子 下一个帖子
标签:
@IocBean
@Service(interfaceClass= HotwaterGatewayService.class)
public class HotwaterGatewayServiceImpl implements HotwaterGatewayService {
[DEBUG] 16:08:41.164 [main] org.nutz.ioc.impl.ScopeContext - Remove object 'hotwaterHttpDownMessageController' from [app] 
[ERROR] 16:08:41.170 [main] org.tio.http.server.mvc.Routes - org.nutz.ioc.IocException: IocBean[hotwaterHttpDownMessageController] throw Exception when creating
org.nutz.ioc.IocException: IocBean[hotwaterHttpDownMessageController] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:153)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161)
	at org.nutz.boot.starter.tio.mvc.TioMvcHttpServerBeans.getInstance(TioMvcHttpServerBeans.java:135)
	at org.tio.http.server.mvc.Routes$1.handler(Routes.java:202)
	at org.tio.utils.hutool.ClassUtil.findClassesByFile(ClassUtil.java:420)
	at org.tio.utils.hutool.ClassUtil.findClassesByFile(ClassUtil.java:408)
	at org.tio.utils.hutool.ClassUtil.findClassesByFile(ClassUtil.java:408)
	at org.tio.utils.hutool.ClassUtil.findClassesByFile(ClassUtil.java:408)
	at org.tio.utils.hutool.ClassUtil.findClassesByFile(ClassUtil.java:408)
	at org.tio.utils.hutool.ClassUtil.findClassesByFile(ClassUtil.java:408)
	at org.tio.utils.hutool.ClassUtil.scanPackage(ClassUtil.java:379)
	at org.tio.http.server.mvc.Routes.addRoutes(Routes.java:194)
	at org.tio.http.server.mvc.Routes.<init>(Routes.java:138)
	at org.nutz.boot.starter.tio.mvc.TioMvcHttpServerBeans.getHttpServerStarter(TioMvcHttpServerBeans.java:120)
	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.lang.Invoking$DefaultInvoker.invoke(Invoking.java:47)
	at org.nutz.lang.Invoking.invoke(Invoking.java:192)
	at org.nutz.lang.Mirror.invoke(Mirror.java:1135)
	at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:80)
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:161)
	at org.nutz.boot.starter.tio.mvc.TioMvcStarter.start(TioMvcStarter.java:22)
	at org.nutz.boot.AppContext.startServers(AppContext.java:310)
	at org.nutz.boot.NbApp.execute(NbApp.java:210)
	at org.nutz.boot.NbApp.run(NbApp.java:182)
	at cn.wizzer.app.bp.DubboRpcBpMainLauncher.main(DubboRpcBpMainLauncher.java:55)
Caused by: java.lang.RuntimeException: IocBean[hotwaterHttpDownMessageController] fail at field=[hotwaterGatewayService]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 33 common frames omitted
Caused by: org.nutz.ioc.IocException: IocBean[class:cn.wizzer.app.gateway.modules.services.HotwaterGatewayService] none ioc bean match class=cn.wizzer.app.gateway.modules.services.HotwaterGatewayService
	at org.nutz.ioc.impl.NutIoc.getByType(NutIoc.java:461)
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:66)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 35 common frames omitted
2 回复

inject的地方没加@Reference

加了@Reference ,还是这样。

    @Inject
    @Reference
    HotwaterGatewayService hotwaterGatewayService;
添加回复
请先登陆
回到顶部