Failed to bind properties under 'mybatis.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping


springboot 2.2.0版本在和mybatis整合过程中使用tomcat 启动会报错,而使用自带的启动器就没啥事,今天再部署的时候遇到的坑,记录一下

Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'mybatis.configuration.mapped-statements[0].parameter-map.parameter-mappings[0]' to org.apache.ibatis.mapping.ParameterMapping

其实就是mybatis不能注入 dao层的接口

修正的办法,简单有效,修改pom.xml,把springboot的版本更改一下就可以了,只要不是2.2.0的

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.1.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
</parent>

修改完文件之后需要更新maven文件,记得重新打包!tomcat运行的是war包,要不然你改了也白改

 

目前我在累码过程中这个bug只有在使用tomcat启动的时候会有!

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM