ssh框架用的注解 页面跳转action报错。看不懂啊求解~
exceptionUnabletoinstantiateAction,com.broadengate.ipc.web.action.userinfo.LoginActio...
exception
Unable to instantiate Action, com.broadengate.ipc.web.action.userinfo.LoginAction, defined for 'login' in namespace '/ipcCommon'Error creating bean with name 'com.broadengate.ipc.web.action.userinfo.LoginAction': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.broadengate.ipc.service.userinfo.UserService] is defined: Unsatisfied dependency of type [interface com.broadengate.ipc.service.userinfo.UserService]: expected at least 1 matching bean
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:307)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) 展开
Unable to instantiate Action, com.broadengate.ipc.web.action.userinfo.LoginAction, defined for 'login' in namespace '/ipcCommon'Error creating bean with name 'com.broadengate.ipc.web.action.userinfo.LoginAction': Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.broadengate.ipc.service.userinfo.UserService] is defined: Unsatisfied dependency of type [interface com.broadengate.ipc.service.userinfo.UserService]: expected at least 1 matching bean
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:307)
com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:388)
com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:187)
org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:478)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) 展开
2个回答
展开全部
No unique bean of type [com.broadengate.ipc.service.userinfo.UserService] is defined: Unsatisfied dependency of type [interface com.broadengate.ipc.service.userinfo.UserService]: expected at least 1 matching bean
-------------------
你那个action引用的service没有实例化 xxService 没有注入进来
-------------------
你那个action引用的service没有实例化 xxService 没有注入进来
追问
我用的注解怎么注入呢 好像service说dao也没注入。
追答
那就表示 你的dao没有实例化 导致service没有实例化 从而action在调用时候就报错了~
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询