org.apache.ibatis.binding.BindingException: Invalid bound statement

    xiaoxiao2023-11-05  203

    楔子

    org.apache.ibatis.binding.BindingException: Invalid bound statement 提示错误

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.zhuzi.camel.bus.dao.YmFamMapper.selectByPrimaryKey at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:225) at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:48) at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:65) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58) at com.sun.proxy.$Proxy54.selectByPrimaryKey(Unknown Source) at com.zhuzi.camel.bus.service.impl.YmFamServiceImpl.getById(YmFamServiceImpl.java:32) at com.zhuzi.camel.handler.MyTCPOrderHandler2.hadler(MyTCPOrderHandler2.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    原因

    使用IDEA 编译 在 `target\classes\com\**\dao` 目录下,没有把`Mapper.xml` 文件包含进来

    解决

    调整 pom.xml文件,使打包时加入 Mapper.xml 文件 <build> <!-- 打包命令 --> <!-- mvn clean dependency:copy-dependencies -DoutputDirectory=target/lib package --> <!-- <finalName>${artifactId}-${version}</finalName> 这是默认名 ,修改打包名称可以修改这个 --> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build>
    最新回复(0)