`

ssm框架报500问题

 
阅读更多

 POST http://localhost:8080/GKBANK2/fileUpload/getExcel.action 500 (Internal Server Error)

f.support.ajax.f.ajaxTransport.send @ jquery-1.7.2.min.js:4

f.extend.ajax @ jquery-1.7.2.min.js:4

poiexcel @ welcome.jsp:53

onclick @ welcome.jsp:631

HTTP Status 500 - Unable to instantiate Action, fileUploadAction, defined for 'getExcel' in namespace '/fileUpload'Error creating bean with name 'fileUploadAction': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.bank.service.FileUploadService com.bank.action.FileUploadAction.fileUploadService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.bank.service.FileUploadService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 

普及:@Autowired可以对成员变量、方法和构造函数进行标注,来完成自动装配的工作,这里必须明确:@Autowired是根据类型进行自动装配的,如果需要按名称进行装配,则需要配合@Qualifier使用;

问题解决:这是action中 @Autowired 注入service 的问题。

把servcieImpl 加上注解@Service @Transactional

daoImpl加上注解@Repository 就解决了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics