[org.mybatis.spring.SqlSessionFactoryBean]-Property 'mapperLocations' was specified but matching resources are not found. 21:42:18.572 [RMI TCP Connection(4)-127.0.0.1] ERROR org.mybatis.spring.mapper.MapperFactoryBean - Error while adding the mapper 'interface com.mycom.dao.StudentMapper' to configuration. org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/mycom/dao/StudentMapper.xml'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.mycom.domain.Student'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.mycom.domain.Student
时间: 2023-10-08 07:07:47 浏览: 61
这个错误信息是MyBatis在解析Mapper XML文件时出现的问题。
首先,这个错误提示了两个问题。第一个问题是在指定的mapperLocations下找不到匹配的Mapper XML文件,这个问题可能和我之前提到的原因类似,需要检查路径、文件名和文件是否存在。第二个问题是在解析Mapper XML文件时,发现无法解析一个类的别名(Type Alias),原因是找不到这个类,这个问题可能和类的导入有关。
根据错误信息中提供的信息来看,可能存在以下几个原因:
1. StudentMapper.xml文件不存在或者路径不正确。需要检查mapperLocations中的路径是否正确,是否遗漏了文件夹或文件名。
2. StudentMapper.xml文件中定义的类别名(com.mycom.domain.Student)不存在或者路径不正确。需要检查这个类的路径是否正确,以及是否导入了这个类。
3. 如果以上两个问题都排查了还是不行,可以尝试重启应用程序或者重新生成Mapper XML文件。
相关问题
Dependency 'org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2' not found
这个错误提示表明在你的项目中找不到名为'org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2'的依赖项。这可能是由于以下几个原因导致的:
1. 依赖项版本错误:请确保你在项目的构建文件(如pom.xml或build.gradle)中正确指定了依赖项的版本号,并且该版本号存在于仓库中。
2. 仓库配置错误:请检查你的构建文件中是否正确配置了仓库地址,以确保能够从仓库中获取到所需的依赖项。
3. 依赖项不存在:可能该依赖项在指定的仓库中不存在。你可以尝试更新依赖项的版本,或者查找其他可用的替代依赖项。
Could not find artifact org.mybatis.spring.boot:mybatis-spring-boot-starter
Could not find artifact org.mybatis.spring.boot:mybatis-spring-boot-starter 是指在maven仓库中找不到 org.mybatis.spring.boot:mybatis-spring-boot-starter 的jar包。根据引用和引用的信息,这可能是由于使用的阿里云的maven仓库没有包含该jar包导致的。如果仓库中没有该jar包,就无法通过maven引入该依赖。一种解决方法是手动下载该jar包,并将其安装到本地仓库中。另一种方法是检查pom.xml文件,确保groupId、artifactId和version都正确,并尝试切换到其他可用的maven仓库。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Could not find artifact org.springframework.boot:spring-boot-starter-parent:jar](https://blog.csdn.net/a1004314120/article/details/128584548)[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 ]
相关推荐
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)