简体   繁体   English

UnsatisfiedDependencyException:创建名称为'accountController'的bean时出错

[英]UnsatisfiedDependencyException: Error creating bean with name 'accountController'

I've been following a tutorial video for web development using Spring . 我一直在关注使用Spring进行Web开发的教程视频。

Here is the complete source code. 是完整的源代码。

Following is the error I get when sending a GET request to 以下是将GET请求发送到时出现的错误

localhost:8080/basic-web-app/rest/accounts 本地主机:8080 / basic-web-app / rest / accounts

https://drive.google.com/open?id=0B5FM3CiBT2VPYWM2MzRVUG9wSGM https://drive.google.com/open?id=0B5FM3CiBT2VPYWM2MzRVUG9wSGM

In file mvc-dispatcher-servlet.xml you specified package for scan as: 在文件mvc-dispatcher-servlet.xml将要扫描的软件包指定为:

<context:component-scan base-package="app.rest.mvc"/>

But all services and repositories are placed in the package app.core . 但是所有服务和存储库都放在app.core包中。 Because of this Spring can't find classes of services and does not instantiate service beans. 因此,Spring无法找到服务类,也无法实例化服务bean。 Just change package that have be to scanned for the next: 只需更改要扫描下一个程序包:

<context:component-scan base-package="app.rest.mvc, app.core"/>

Then Spring will find all components of the application. 然后,Spring将找到应用程序的所有组件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 创建名称为&#39;accountController&#39;的bean时出错 - Error creating bean with name 'accountController' UnsatisfiedDependencyException - 创建具有名称的 bean 时出错 - UnsatisfiedDependencyException - Error creating bean with name UnsatisfiedDependencyException:使用名称创建 bean 时出错 - UnsatisfiedDependencyException: Error creating bean with name 错误:UnsatisfiedDependencyException:创建名为“entityManagerFactory”的 bean 时出错 - Error: UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' Jenkins 构建 UnsatisfiedDependencyException:创建带有名称的 bean 时出错 - Jenkin build UnsatisfiedDependencyException: Error creating bean with name UnsatisfiedDependencyException:创建名称为“registrationController”的 bean 时出错 - UnsatisfiedDependencyException: Error creating bean with name 'registrationController' REST API 中创建bean名时出现UnsatisfiedDependencyException错误 - UnsatisfiedDependencyException error in creating bean name in REST API UnsatisfiedDependencyException:创建名为“empController”的bean时出错 - UnsatisfiedDependencyException: Error creating bean with name “empController” UnsatisfiedDependencyException:创建名为“entityManagerFactory”的 bean 时出错 - UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' UnsatisfiedDependencyException:创建名称为“ trafficMapper”的bean时出错 - UnsatisfiedDependencyException: Error creating bean with name 'trafficMapper'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM