关于tx:annotation-driven 和mapperLocations的问题

cpp_1 2020-10-09 12:26:08
我在整合spring+mybatis时,有这样二个错
1。开启事件注解驱动,就一直在报错。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.event.internalEventListenerProcessor': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: 'boolean org.springframework.core.annotation.AnnotationUtils.isCandidateClass(java.lang.Class, java.lang.Class)'

2。在用mapperLocations 时,一直在报
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.SqlSessionFactoryBean#0' defined in class path resource [Spring.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 [classpath:com/test/ssm/mapper/*.xml]: class path resource [com/test/ssm/mapper/] cannot be resolved to URL because it does not exist


...全文
3819 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
cpp_1 2020-10-09
  • 打赏
  • 举报
回复
还确实是JAR包版本的问题引起的。。
lolitaline 2020-10-09
  • 打赏
  • 举报
回复
可能是jar包版本的问题
cpp_1 2020-10-09
  • 打赏
  • 举报
回复
对的新搭建的,里面没有逻辑程序 现在就一个配置文件整合,都报错
liuyh1024 2020-10-09
  • 打赏
  • 举报
回复
你是新搭建的项目吗
cpp_1 2020-10-09
  • 打赏
  • 举报
回复
有没有,进一步的解决信息 现在这个都不知道怎么查起。。。
KeepSayingNo 2020-10-09
  • 打赏
  • 举报
回复
首选先检查是否存在该路径,如果不存在那么只需要在对应的resources上建立对应的文件即可 ,再看看对应路径上是否存在mapper.xml,如果没有则需要建立文件,因为mybatis没有文件会报 错。 重点检查:classpath:com/test/ssm/mapper/*.xml

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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