写此为以后报错忘了为啥做准备 希望早日能自己快速解决所有报错
一、 log4j
报错:
原因:log4j配置文件有问题导致没法加载
【疑问】这个log4j的在哪里找到的呀?请不嫌弃我的大佬求教!
二、
报错:
org.apache.ibatis.exceptions.PersistenceException:
### Error building SqlSession.
### The error may exist in com/itheima/dao/IUserDao.xml
### The error occurred while processing mapper_resultMap[userRoleMap]
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'com/itheima/dao/IUserDao.xml'. Cause: org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property 'roles'. You must specify 'javaType' or 'resultMap'.
**原因:**在IUserDao.xml中collection标签的property属性的值必须和User实体类中的属性roles命名一致。
报错时正因为User类中的roles我自定义了名字,而xml中写的是roles而无法找到。