关于IDEA整合SpringMVC和myBatis的异常问题

被夹毛局的程序员 2017-09-12 04:04:19
请教各位大佬一个问题..关于IDEA整合SpringMVC和Mybatis的时候..报Mapper文件的路径找不到的问题..但是我用Junit4测试的时候没有问题..用tomcat启动的时候报sqlSessionFactoryBean的MapperLoactions属性有问题....

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [application.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: 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 [com/ljljob/crm/mapper/*Mapper.xml]: ServletContext resource [/com/ljljob/crm/mapper/] cannot be resolved to URL because it does not exist

...全文
208 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 3 楼 pany1209 的回复:
Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [com/ljljob/crm/mapper/*Mapper.xml]:....很明显的mapperLocations的value的路径配置错误
但是我用Junit4跑的时候同样的配置没有问题..只是在启动tomcat的时候报这个错误
李德胜1995 2017-09-12
  • 打赏
  • 举报
回复
Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [com/ljljob/crm/mapper/*Mapper.xml]:....很明显的mapperLocations的value的路径配置错误
  • 打赏
  • 举报
回复
  • 打赏
  • 举报
回复

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧