“Type interface is not known to the MapperRegistry” exception using mybatis

前端 未结 7 677
野性不改
野性不改 2021-02-02 15:23

I\'m setting up mybatis using annotations, and getting this helpful exception

org.apache.ibatis.binding.BindingException: Type interface org.foo.Bar is

7条回答
  •  执念已碎
    2021-02-02 15:45

    Happened to me when creating a shadowJar/bootJar for a spring boot project and using org.springframework.boot gradle plugin

    When the jars are zipped inside the bootJar myBatis may fail to find the XML configuration files and will throw the described exception

    adding this block in the build.gradle file:

    bootJar {
        requiresUnpack '**/MyProblematic.jar'
    }
    

    solved my problem

提交回复
热议问题