出现的问题
出现的问题
- mybatis的mapper测试类报空指针
测试类上加注解
@SpringBootTest(classes = SecurityApplication.class)
@RunWith(SpringRunner.class)
- idea启动项目报 找不到 包
mvn idea: idea

- mapper注入失败 找不到
Could not autowire. No beans of 'UserMapper' type found.
https://img-blog.csdnimg.cn/img_convert/5081a583d0271e742e963c655246d810.png
4. IDEA启动项目时报Error:Kotlin: Module was compiled with an incompatible version of Kotlin.
升级Kotlin插件

在idea2020使用jdk17
Error:Cannot determine path to 'tools.jar' library for 17 (D:\Programs\Java\Jdk17)
JDK17是2021才推出的,所以2020版本IDE不支持JDK17的版本,所以运行不了
Error:(3,37) java: 无法访问org.mybatis.spring.annotation.MapperScan
mybatis-plus版本太高 3.0.1 换成2.2.2
IDEA安装后双击打开无任何反应
找到以下目录:C:\Users\xj\AppData\Roaming\JetBrains\IntelliJIdea2021.2
编辑idea64.exe.vmoptions文件
删除最后一行-javaagent……的相关信息,保存后重新运行IDEA即可。
解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
从mybatis转到 mybatis-plus
mybatis-plus Invalid bound statement (not found): com.biglead.demo.mapper.UserCategoryMapper.selectPage
修改配置类
@Configuration
@MapperScan("com.biglead.demo.mapper")
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
return interceptor;
}
}
启动redis服务 报错Address already in use redis无法启动问题
ps -ef | grep -i redis
杀死进程命令
kill -9 2877

浙公网安备 33010602011771号