在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)
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
原因是ioc目录下有个这样的文件
var ioc = {
AppId : "..........."
}
定义了几个字符串,而这个就跟1.r.55 的@Inject新特性有冲突, 导致问题, 修正如下, 将包含在1.r.56
https://github.com/nutzam/nutz/commit/62bfdd0b2c6d59da4881f2efc6fecbefd2d9093a