本系列博客主要介绍的是在利用ssm整合开发web项目的时候,开始配置ssm整合文件的时候,遇到各种懵逼的问题(其实很简单的问题,你可能会解决半天都没解决),本人遇到第一个问题是,报出的异常时:
Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [classpath:mapper/*.xml]: class path resource [mapper/] cannot be resolved to URL because it does not exist
我在配置完ssm文件之后,spring springmvc mybatis配置文件查了好多次基本是没有错误,原本以为是Tomcat的问题,又重启了服务器,还是报错,这种报错没有明确之后是里的问题,只能再去查看三个配置文件,最终在mybatis的配置文件中发现了一低级语法错误,即在第六行多了一“<”,去除之后,重新测试,问题解决。
总结:在编写的mybatis的配置文件是,需要十分注意,如果是自己编写,需要把<!DOCTYPE>头部引入,并且所有的配置问价需要写在configuration标签里面,否则就会报错,最好直接利用mybatis的帮助文档编写。
本人将会继续将更新博客,在利用ssm整合时遇到的问题都会继续分享给大家。