今天在敲代码的时候出现了bug:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tonameMapper' defined in file [D:\project\零一电科\技术资料\lingyidianke\zeroBackEnd\ZerosBackEnd\target\classes\zero\file\videoProject\mappers\untils\tonameMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'zero/file/videoProject/mappers/untils/tonameMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected 'zero.file.videoProject.mappers.untils.tonameMapper' but found 'zero.file.videoProject.mappers.untils'.
翻译
原因:org . spring framework . beans . factory . beancreationexception:创建在文件【D:\project\零一电科\技术资料\ lingyidianke \ zero back end \ ZerosBackEnd \ target \ classes \ zero \ file \ video project \ mappers \ untils \ tonamemapper . class】:调用init方法失败;嵌套异常为Java . lang . illegalargumentexception:org . Apache . ibatis . builder . builder异常:解析映射器XML时出错。XML位置为“zero/file/video project/mappers/until s/tonamemapper . XML”。原因:org . Apache . ibatis . builder . builder异常:错误的命名空间。应为“zero . file . video project . mappers . untils . tonamemapper”,但找到了“zero . file . video project . mappers . untils”。
自己xml文件的命名空间只定义到了untils当中,而没有定义tonameMapper这里
改成这样就行了,复制与tonameMapper文件相同就行了