重新框架的运行时报错,因为框架是自己拉来的 功能自己新加的加入mybatisplus之后运行报错
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘restShiroFilterFactoryBean’ defined in class path resource [lb/lingbing/common/config/ShiroConfig.class]: Unsatisfied dependency expressed through method ‘restShiroFilterFactoryBean’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘securityManager’ defined in class path resource [lb/lingbing/common/config/ShiroConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.shiro.mgt.SecurityManager]: Factory method ‘securityManager’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userNameRealm’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userService’: Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘userMapper’ defined in file [E:\zmq\瑞田\Shiro-RuiTian\target\classes\lb\lingbing\system\mapper\UserMapper.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method ‘sqlSessionFactory’ threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘class path resource [lb.lingbing.lingbingadd.mapper]’; nested exception is java.io.FileNotFoundException: class path resource [lb.lingbing.lingbingadd.mapper] cannot be opened because it does not exist
报错点是这里 经过发现是以为mapper没有映射到
我用的是springboot + mybatis plus 解决方法是在application的运行里加上注解
加上第二个并对应相关的mapper包 完美解决