NutzCN Logo
问答 nutzboot duboo 跨模块调用启动报错,微信调用用户模块时,报错,怎么办
发布于 2094天前 作者 buyubuyu 1412 次浏览 复制 上一个帖子 下一个帖子
标签:
package cn.wizzer.app.wx.modules.services.impl;

import cn.wizzer.app.sys.modules.services.SysUserService;
import cn.wizzer.framework.base.service.BaseServiceImpl;
import cn.wizzer.app.wx.modules.models.Wx_user;
import cn.wizzer.app.wx.modules.services.WxUserService;
import com.alibaba.dubbo.config.annotation.Service;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;

@IocBean(args = {"refer:dao"})
@Service(interfaceClass=WxUserService.class)
public class WxUserServiceImpl extends BaseServiceImpl<Wx_user> implements WxUserService {
    public WxUserServiceImpl(Dao dao) {
        super(dao);
    }

    @Inject
    private SysUserService sysUserService;
}

[DEBUG] 17:28:36.544 [main] org.nutz.ioc.loader.combo.ComboIocLoader - Found IocObject(wkcacheRemoveEntryInterceptor) in AnnotationIocLoader(packages=[org.nutz.plugins.wkcache])
[DEBUG] 17:28:36.544 [main] org.nutz.ioc.loader.combo.ComboIocLoader - Found IocObject(wkcacheUpdateInterceptor) in AnnotationIocLoader(packages=[org.nutz.plugins.wkcache])
[DEBUG] 17:28:36.544 [main] org.nutz.ioc.impl.ScopeContext - Remove object 'wxUserServiceImpl' from [app] 
[DEBUG] 17:28:36.544 [main] org.nutz.ioc.impl.ScopeContext - Remove object 'dubboAnnotationBean' from [app] 
[DEBUG] 17:28:36.544 [main] org.nutz.ioc.impl.ScopeContext - Remove object 'dubboManager' from [app] 
[ERROR] 17:28:36.546 [main] org.nutz.boot.NbApp - something happen!!
org.nutz.ioc.IocException: IocBean[dubboManager -> dubboAnnotationBean -> wxUserServiceImpl] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
	at org.nutz.ioc.impl.NutIoc.getByType(NutIoc.java:457)
	at org.nutz.ioc.impl.NutIoc.getByType(NutIoc.java:426)
	at org.nutz.integration.dubbo.AnnotationBean._init(AnnotationBean.java:73)
	at org.nutz.integration.dubbo.AnnotationBean$FM$_init$cff301be46c87e2fbea60f4ef344bacb.invoke(AnnotationBean.java)
	at org.nutz.ioc.impl.ObjectMakerImpl$2.trigger(ObjectMakerImpl.java:180)
	at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:89)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at org.nutz.integration.dubbo.DubboManager.init(DubboManager.java:31)
	at org.nutz.integration.dubbo.DubboManager._init(DubboManager.java:24)
	at org.nutz.integration.dubbo.DubboManager$FM$_init$cff301be46c87e2fbea60f4ef344bacb.invoke(DubboManager.java)
	at org.nutz.ioc.impl.ObjectMakerImpl$2.trigger(ObjectMakerImpl.java:180)
	at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:89)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)
	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.dubbo.DubboStarter.start(DubboStarter.java:17)
	at org.nutz.boot.AppContext.startServers(AppContext.java:306)
	at org.nutz.boot.NbApp.execute(NbApp.java:206)
	at org.nutz.boot.NbApp.run(NbApp.java:178)
	at cn.wizzer.app.wx.commons.core.DubboRpcWxMainLauncher.main(DubboRpcWxMainLauncher.java:31)
Caused by: java.lang.RuntimeException: IocBean[wxUserServiceImpl] fail at field=[sysUserService]
	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)
	... 24 common frames omitted
Caused by: org.nutz.ioc.IocException: IocBean[class:cn.wizzer.app.sys.modules.services.SysUserService] none ioc bean match class=cn.wizzer.app.sys.modules.services.SysUserService
	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)
	... 26 common frames omitted
4 回复

SysUserService在sys模块, 需要加dubbo注解才能注入哦

请问应该加什么注解,怎么加注解才能注入呢 这是当前的SysUserService的注解 @wendal

@IocBean(args = {"refer:dao"})
@Service(interfaceClass = SysUserService.class)
@CacheDefaults(cacheName = "sys_user")
public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements SysUserService {

引用的地方加@Reference

问题解决,谢谢!

添加回复
请先登陆
回到顶部