错误提示:### Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.study.dao.StudentDao.selectStudent
- 看的这个错误后,我去对比了一下mapper.xml的命名空间还有id是否跟接口口中的一致。
- 检查发现一致。mybatis的配置文件也之很正常。我就去看了一下target目录,结果发现target目录下并没有StudentDao.xml这个文件
- 修改错误:在pom文件中加入以下内容
<resources>
<resource>
<directory>src/main/java</directory><!--所在的目录-->
<includes><!--包括目录下的.properties,.xml 文件都会扫描到-->
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
4. 这个问题解决后,又出现一个新的错误:Cause: java.sql.SQLException: The server time zone value 5. 解决办法:在jdbc:mysql://localhost:3306/ssm?serverTimezone=UTC 加上UTC 6. 编译通过后,又出现一个红字警告:Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. 7. 解决办法:jdbc.driver的值改为com.mysql.cj.jdbc.Driver