今天测试使用JdbcTemplate,报错,报错内容如下:
Multiple markers at this line
- The type org.springframework.dao.DataAccessException cannot be resolved. It is indirectly referenced from
required .class files
- The method update(String) from the type JdbcTemplate refers to the missing type DataAccessException

最开始以为是jre版本过高了,改成1.6还是同样的问题,后来发现是有一个包spring-tx-4.1.5.RELEASE.jar,没有放到lib里面,下载粘贴进去,build to path错误就消失了


本文分享了在使用Spring框架的JdbcTemplate时遇到DataAccessException错误的解决方案。通过检查并引入缺失的spring-tx依赖,成功解决了JdbcTemplate更新方法中引用类型未解析的问题。
346

被折叠的 条评论
为什么被折叠?



