NutzCN Logo
问答 java.lang.String cannot be cast to java.util.Map FAIL to create Ioc Bean
发布于 3185天前 作者 qq_36124293 2981 次浏览 复制 上一个帖子 下一个帖子
标签:

在control中注入wxIntefaceService 报如下错误,望高手解答
[WARN][org.nutz.mvc.impl.processor.FailProcessor] - Error@/admin/system-login :
org.nutz.ioc.IocException: java.lang.String cannot be cast to java.util.Map FAIL to create Ioc Bean name=[wxIntefaceService]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:147)

8 回复

贴完整报错信息及相关的全部配置

2016-04-08 20:32:05,758 [WARN][org.nutz.mvc.impl.processor.FailProcessor] - Error@/admin/system-login :
org.nutz.ioc.IocException: java.lang.String cannot be cast to java.util.Map FAIL to create Ioc Bean name=[wxIntefaceService]
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 cn.wizzer.modules.system.action.LoginAction.login(LoginAction.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:25)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:196)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.nutz.ioc.loader.map.MapLoader.getMap(MapLoader.java:128)
at org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:63)
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:147)
at org.nutz.ioc.impl.NutIoc.getNamesByType(NutIoc.java:326)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:32)
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)
... 34 more

这个不涉及到配置哈

不要截面!!!!!!!!!!!!!!

wxapi的配置, dao的配置, daoCtl 的配置都要贴

问题解决了,谢谢兽总

原因是ioc目录下有个这样的文件

var ioc = {
    AppId : "..........."
}

定义了几个字符串,而这个就跟1.r.55 的@Inject新特性有冲突, 导致问题, 修正如下, 将包含在1.r.56

https://github.com/nutzam/nutz/commit/62bfdd0b2c6d59da4881f2efc6fecbefd2d9093a

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