首页 > 其他 > 详细

后台常见报错处理

时间:2017-09-08 17:32:19      阅读:201      评论:0      收藏:0      [点我收藏+]

1、接口注入问题:

@Controller
@Scope("prototype")
public class GenuineManagementAction extends BaseAction {

    private static final long serialVersionUID = -3797612994929924322L;

    @Resource
    private GenuineManagementService genuineManagementService;
    @Resource//这样写是有问题的,去掉即可正常
    private GenuineManagement genuineManagement;

}
  @Resource代表注入,只有接口才能注入,而GenuineManagement 是一个实体类,所以加上@Resource 会报如下错误:
Unable to instantiate Action, genuineManagementAction, 
No matching bean of type [com.vrv.paw.domain.GenuineManagement] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
Unable to instantiate Action, genuineManagementAction,  defined for genuineManagementAction_listUI in namespace /Error creating bean with name genuineManagementAction: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.vrv.paw.domain.GenuineManagement] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)} - action - file:/E:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp4/wtpwebapps/JJFX/WEB-INF/classes/struts-extend.xml:420:89
    at com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:318)

2、

后台常见报错处理

原文:http://www.cnblogs.com/goloving/p/7495036.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!