背景:
使用idea2021版本开发springboot项目,有 一段时间。遇到不少坑和问题,现总结下排查解决过程,做一个记录。
问题:
1. idea 2021版本安装后,打开提示需要总提示需要激活,
解决:网上搜索idea2021破解教程,我用的eval-reset插件破解
下载地址:https://plugins.zhile.io/files/ide-eval-resetter-2.2.3-031813.zip
https://zhile.io/2020/11/18/jetbrains-eval-reset-da33a93d.html
2. idea 打开springboot项目运行xxxApplication
报错信息:
Error running 'Application':
Command line is too long.Shorten command line for Application or also for Spring Boot default configuration.
解决:
点击项目启动配置项 -> shorten command line 选项选择 classpath file 或 java manifest 选项 -> 重新启动工程运行即可
背景:
使用idea2021版本开发springboot项目,有 一段时间。遇到不少坑和问题,现总结下排查解决过程,做一个记录。
问题:
1. idea 2021版本安装后,打开提示需要总提示需要激活,
解决:网上搜索idea2021破解教程,我用的eval-reset插件破解
下载地址:https://plugins.zhile.io/files/ide-eval-resetter-2.2.3-031813.zip
https://zhile.io/2020/11/18/jetbrains-eval-reset-da33a93d.html
2. idea 打开springboot项目运行xxxApplication
报错信息:
Error running 'Application':
Command line is too long.Shorten command line for Application or also for Spring Boot default configuration.
解决:
点击项目启动配置项 -> shorten command line 选项选择 classpath file 或 java manifest 选项 -> 重新启动工程运行即可
3. idea单元测试启动,提示命令太长,
解决:
1、找到 .idea 文件夹下面的 workspace.xml
2、在 <component name="PropertiesComponent"> 标签下插入一行 <property name="dynamic.classpath" value="true" />
3、重新启动,ok,解决
4. springboot项目使用了mybatisplus报错
Description:
Field baseMapper in com.baomidou.mybatisplus.extension.service.impl.ServiceImpl required a single bean, but 11 were found:
- classGradeMapper: defined in file [D:\java_space\et-tranning\et-bus\et-bus-service\target\classes\com\hicon\et\mapper\ClassGradeMapper.class]
- classMapper: defined in file [D:\java_space\et-tranning\et-bus\et-bus-service\target\classes\com\hicon\et\mapper\ClassMapper.class]
排查:检查service引用,没有按规范使用,没传入对应的po,mapper对象
解决:引用IService、ServiceImpl没有引用对应po,mapper
或者
5. springboot项目使用@Resource或者@Autowired注解 引用bean,有时候找不到这个bean,编译失败
排查:
@Resource
CoursePlanService planService;
解决:使用@Resource或者@Autowired注解 引用bean,要求使用驼峰式和引用类名字一致;
6. springboot 项目无法启动,nocas对应配置错误
解决:根据日志,查找nocas进行配置