## ssm整合的时候遇到的异常
作者:互联网
ssm整合的时候遇到的异常
**具体错误
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userController’: Unsatisfied dependency expressed through field ‘UserServiceImpl’; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named ‘userServiceImpl’ is expected to be of type ‘com.jacob.service.impl.UserServiceImpl’ but was actually of type ‘com.sun.proxy.$Proxy29’
三月 18, 2021 11:06:43 下午
部分代码
报错原因:
@Autowired 注入实现类的话就会报这个错误
解决方案:
将自动注入的实现类该为接口即可
标签:UserServiceImpl,##,factory,springframework,ssm,beans,整合,org 来源: https://blog.csdn.net/weixin_53098110/article/details/114993584