Error creating bean with name 'tbItemParamExtendMapper' defined in file

记一次错误,自己写的mapper接口和mapper.xml,结果将类型写错了,报下面的错误

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemParamServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private cn.e3mall.param.mapper.TbItemParamExtendMapper cn.e3mall.service.impl.ItemParamServiceImpl.itemParamExtendMapper; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cn.e3mall.param.mapper.TbItemParamExtendMapper] 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 'tbItemParamExtendMapper' defined in file [E:\project\workspace\JavaEE32\e3-manager\e3-manager-service\target\classes\cn\e3mall\param\mapper\TbItemParamExtendMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'LONGVACHAR'.  Cause: java.lang.ClassNotFoundException: Cannot find class: LONGVACHAR
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tbItemParamExtendMapper' defined in file [E:\project\workspace\JavaEE32\e3-manager\e3-manager-service\target\classes\cn\e3mall\param\mapper\TbItemParamExtendMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'LONGVACHAR'.  Cause: java.lang.ClassNotFoundException: Cannot find class: LONGVACHAR
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)

 

解决办法

mapper.xml文件中

将红框内容改为jdbcType="LONGVARCHAR"

问题修改为

ResultType 改为 ResultMap

问题总结:

     遇见Bug一定要耐心,细心,只有去耐心的去看报错信息,才能更快的解决问题。心烦意躁,急迫的想解决问题,反而问题不容易解决。这次错误花费了我一晚上,心烦意燥的代价,发现每次Bug修改都花费较多时间,每次都是自己不细心,没有仔细看报错信息,导致花费较多时间,

记以后遇见Bug要沉着冷静

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用:经过一天的折磨,查资料、看视频排除了以下几种可能      1、注解的注入      2、配置的id      3、jar架包的冲突      4、配置 tomcat 的问题   最后,再回到错误的信息上来;才发现我的着重点放错了位置。其实最主要的错误信息试 Could not determine type for: java.lang.Timestamp, at table: IndentlistVo, for columns:大概意思就是中不到java.lang.Timestamp的类型,改为java.sql.Timestamp,就OK啦!!!。 问题:请告诉我,Error creating bean with name 'employeeDao' defined in file中的错误是什么? 根据提供的引用内容,无法确定具体的错误是什么,因为引用内容仅描述了排除了一些可能性并解决了一个问题,但并没有提供关于"Error creating bean with name 'employeeDao' defined in file"的具体错误信息。如果能提供更详细的错误信息,将有助于进一步分析和解决问题。<span class="em">1</span> #### 引用[.reference_title] - *1* [轻松解决 “Error creating bean with name 'indentDao' defined in file”的错误(一)](https://blog.csdn.net/weixin_43741599/article/details/104242007)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值