接手别人的项目,从eclipse导入idea,配置好其服务后一直报错,是配置文件初始化步骤不对的原因吗

davis_zz 发布于 2019/12/06 09:13
阅读 380
收藏 0

ERROR [RMI TCP Connection(3)-127.0.0.1] - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in ServletContext resource [/WEB-INF/spring-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in ServletContext resource [/WEB-INF/spring-shiro.xml]: Cannot resolve reference to bean 'usernamePasswordRealm' while setting bean property 'realms' with key [0]; nested exception is     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'usernamePasswordRealm': Injection of autowired dependencies failed; nested exception is     org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taipingpropertyrisk.management.user.dao.UserDao com.taipingpropertyrisk.management.user.realm.UsernamePasswordRealm.userDao; nested exception is     org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': Injection of autowired dependencies failed; nested exception is     org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.taipingpropertyrisk.management.user.dao.mapper.UserMapper com.taipingpropertyrisk.management.user.dao.UserDao.userMapper; nested exception is     org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.taipingpropertyrisk.management.user.dao.mapper.UserMapper] 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)}
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-beans.xml]: Invocation of init method failed; nested ex

加载中
0
小伯恩
小伯恩


你好,请仔细查询错误,这都很明显了

0
小象鸭
小象鸭

shiro里面使用了 @Autowired 注入 userDao ,beans.factory找不到这个bean,先顺着shiro里面注入的类往下找有没有缺少注解,再看一下spring全局扫描是否开启了

0
j
jungggle

为啥不用maven?

0
caixiaomao
caixiaomao

UserMapper这个bean没找到,No qualifying bean of type [com.taipingpropertyrisk.management.user.dao.mapper.UserMapper]

caixiaomao
caixiaomao
太平洋保险:joy:
0
答案就在远方
答案就在远方

很常见的错误,就是bean没有注入。

返回顶部
顶部