springboot启动报错

摘要:
springboot启动报错信息org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'userController':Injectionofresourcedependenciesfailed;nestedexceptionisorg.springframework.beans.facto

springboot启动报错信息

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': 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:workspaceidea源代码商城项目mall_review_0 argetclassescomomall_reviewmodeldaoUserMapper.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 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.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: 'file [E:workspaceidea源代码商城项目mall_review_0 argetclassesmappersCartMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:workspaceidea源代码商城项目mall_review_0 argetclassesmappersCartMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'me.zhangbo.mall.model.pojo.Cart'. Cause: java.lang.ClassNotFoundException: Cannot find class: me.zhangbo.mall.model.pojo.Cart

问题解决

前后一共两次遇到相似的报错:
1.mapper.xml中同一个功能的sql写了两遍,重复
2.mapper.xml中sql的parameterType写成了→me.zhangbo.mall.model.pojo.Cart,所以出现上面的提示信息
问题主要都是出现在mapper文件中,可以使用mybatis-generator重新生成

免责声明:文章转载自《springboot启动报错》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇mongo在windos下自动备份spark sql 优化心得下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

spring定时任务原理

参考文章:https://juejin.im/post/5b64448af265da0f7f44c201 https://juejin.im/post/5e338ebae51d4558864b1ca0 1、开发中使用时要注意的点 (0)spring定时任务执行原理实际使用的是JDK自带的ScheduledExecutorService (1)spring默...

shiro的单机版 和 集群版

在我们的开发当中 我们一般权限都是个 比较繁琐 但又必不可少的 一部分 【不管我们的 数据库设计 还是我们采用何种技术 我们的权限库表 大多都是大同小异 业务逻辑也是如此】 在我们不使用任何框架的时候 我们也是可以做到 但是细节过于麻烦 在很多时候 都是重复造轮子的过程 所以出现了 很多开源比较休息的额权限框架如:shiro Spring security...

SpringBoot启动过程解析(简化)

springBoot web方式启动过程 在这个启动过程中会有各种SpringBoot对外提供的扩展接口来对不同启动阶段进行自定义操作。 了解启动过程也是为了让我们更好理解SpringBoot提供的扩展接口使用   jar包启动或者外置war包启动都是调用SpringApplication.run()方法进行项目启动 tomcat会查询context上下文...

Spring整合Hessian访问远程服务

声明:该文章转载自Spring整合Hessian访问远程服务,本人搬过来只是为了记录下学习Hessian的过程,忘此博主理解,在此感谢,等本人有能力了再学一些原创的东东,本人实践了下,hessianServer项目不是web project,由于较菜,花了一个下午才把java project转换成为web project。 项目下载: hessianSer...

JAVA反射之内省

JavaBean: 就是一个java类 属性全部私有,提供公有的getter,setter方法 提供一个无参的构造方法 类必须公有,必须打包 JDK中提供了对JavaBean进行操作的一些API,这套API就称为内省。 内省API: Introspector类: 构建一个全面描述目标 bean 的 BeanInfo 对象 BeanInfo接口:封装bean...

eclipse+maven+ssm框架搭建

eclipse+maven+ssm框架 0、系统环境 1)Windows 10 企业版 2)JDK 1.8.0_131 3)Eclipse Java EE IDE for Web Developers  Version: Neon.3 Release (4.6.3) 4)Tomcat 8.5 1、maven下载及配置 maven的下载地址:http:...