NutzCN Logo
问答 页面跳转,报错.ioc.IocException:,要怎么配置
发布于 2103天前 作者 qq_91afbf68 1738 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

我在使用跳转页面的方法,但是我在加跳转的controller,后就这样了

@IocBean
@At("/public/h5")
@Filters({ @By(type = PrivateFilter.class)})
public class WechatController {
    private static final Log log = Logs.get();
    
    /**
     * 
    * @Title: add
    * @Description: TODO 跳转前端首页
    * @param     参数
    * @return void    返回类型
    * @throws
     */
    @At("/index")
	@Ok("beetl:/public/wx/h5/index/index.html")
	@RequiresAuthentication
	public void index() {
		
	}
    
    

}
[ERROR] 2019-03-21 14:56:48,580 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:125) - Error happend during start serivce!
org.nutz.lang.born.BorningException: Fail to born or cast to 'org.nutz.ioc.loader.annotation.AnnotationIocLoader'
 by args: [@(cn.wizzer)]
 because:org.nutz.ioc.IocException: IocBean[wechatController] Duplicate beanName=wechatController, by cn.wizzer.modules.controllers.front.wx.wechat.WechatController !!  Have been define by cn.wizzer.modules.controllers.front.h5.WechatController !!
	at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:23)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:118)
	at org.nutz.ioc.loader.combo.ComboIocLoader.<init>(ComboIocLoader.java:80)
	at org.nutz.mvc.ioc.provider.ComboIocProvider.create(ComboIocProvider.java:20)
	at org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:381)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:103)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4657)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5304)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1423)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1413)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.nutz.ioc.IocException: IocBean[wechatController] Duplicate beanName=wechatController, by cn.wizzer.modules.controllers.front.wx.wechat.WechatController !!  Have been define by cn.wizzer.modules.controllers.front.h5.WechatController !!
	at org.nutz.ioc.loader.annotation.AnnotationIocLoader.addClass(AnnotationIocLoader.java:96)
	at org.nutz.ioc.loader.annotation.AnnotationIocLoader.<init>(AnnotationIocLoader.java:46)
	at org.nutz.ioc.loader.annotation.AnnotationIocLoader$FC$d0275b2b871e237a38f11859247d1599.invoke(AnnotationIocLoader.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.DynamicConstructorBorning.born(DynamicConstructorBorning.java:17)
	... 22 more
6 回复

类名重复

 Have been define by cn.wizzer.modules.controllers.front.h5.WechatController !!

不在同一个目录页被影响的吗

影响, 不要重复

好的,我设置跳转微信公众号的前端页面是通过这样的控制器跳转的吗?想知道怎么做好一点

微信--微信菜单配置--选择连接,下面有网页oauth2.0 和 应用 oauth2.0,你看下他们的路径,根据需要看代码

http://yhrt.wolfroom.cn/public/wx/wechat/5e449db2486245f0afc0cc36070d2f6c/oauth?goto_url=

像这样的,是不是在等号后面跟着controller的一个@At("/public/h5") 的/public/h5这种

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