搭建passjava报错手册
1.集成人人开源后台管理系统问题
1.1pom.xml标红,但是不报错(强迫症患者)

解决方式:添加版本号即可,但是不知道原理

1.2修改完renren-fast配置文件后启动报错

解决方式:经过检查百度发现是lombok 依赖的问题,讲版本更新为1.18.12以上,<scope>
可以不用加

1.3renren-fast 无法正常启动,提示找不到正确的驱动/数据源

解决方式:都修改为jdk 1.8;如果还不行,清理缓存重启


2.集成人人开源生成代码问题
2.1generator配置修改完后,服务无法启动,找不到数据源

解决方式:mysql-connector-java 版本过低,改成8.x.x即可
2.2服务启动后,进入生成代码页面报错
Invalid bound statement (not found): io.renren.dao.MySQLGeneratorDao.queryList

解决方式:核对了配置文件yml,发现有一处问题,拉下来的代码中yml扫描mapper的地方用的mybatis-plus,但是依赖用的mybaits,所以无法扫描到对应的mapper.xml;修改为mybatis

3.业务模块问题
3.1编译报错

发现问题:不知道为什么生成的jdk是1.5

解决方式:对比了一下其他模块iml文件的内容,发现没有什么区别,直接copy过来,然后重新编译,发现maven又报错了,找不到xxx程序包,研究了一下,发现是一些依赖没下载下来,进入到content的pom.xml文件中,重新下载即可。
3.2代码测试报错
@SpringBootTest
class PassJavaContentApplicationTests {
@Test
void contextLoads() {
System.out.println("true = " + true);
}
}
在PassJavaContentApplictionTests,直接打语句报错,本人一直把目光放在了这个错误上,结果后面经过仔细检查发现是没有导入mybatis-plus的依赖其实,在白色部分的代码已经提示我了,可惜我还没发觉【Failed to introspect meta-annotation org.mybatis.spring.annotation.MapperScan: java.lang.TypeNotPresentException: Type [unknown] not present】

解决方式:在该模块下添加mybatis-plus依赖
3.3测试mybatsi-plus的CURD方法报错
@SpringBootTest
class PassJavaContentApplicationTests {
@Autowired
NewsService newsService;
@Test
void contextLoads() {
NewsEntity entity = new NewsEntity();
entity.setId(1L);
entity.setTitle("题目1");
if (newsService.save(entity)) {
System.out.println("成功 = " + entity);
}
}
}

解决方式:熟悉的报错代码【No appropriate protocol (protocol is disabled or cipher suites are inappropriate)】,修改为1.8

3.4添加yml,无法启动服务

解决方式:模块缺失依赖(低级错误)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
3.5Maven clean - install 报错

解决方式:因为在content服务的测试类中添加测试代码,所以检测不通过,选中该按钮即可
