_(:ᗤ」ㄥ)_359 2022-08-06 21:59 采纳率: 70%
浏览 41

Spring做事务案例出现错误

问题遇到的现象和发生背景

在我自学spring中有个bug出现,我在做一个简单事务案例的时候我做测试没有添加事务时spring和mybatis一切正常运行在加上事务的注解后就完全报错,这里是啥问题

问题相关代码,请勿粘贴截图

报错内容
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springConfig': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: 'org.springframework.core.annotation.AnnotationAttributes org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.String)'
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springConfig': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: 'org.springframework.core.annotation.AnnotationAttributes org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes(java.lang.reflect.AnnotatedElement, java.lang.String)'

运行结果及报错内容

img

img

img

img

img

img

img

img

  • 写回答

4条回答 默认 最新

  • 快乐的小小鸟 2022-08-06 23:31
    关注

    明显就是这个bean 不能拿到,在main方法你能取要service对象吗??

    评论

报告相同问题?

问题事件

  • 创建了问题 8月6日

悬赏问题

  • ¥20 python忆阻器数字识别
  • ¥15 无法输出helloworld
  • ¥15 高通uboot 打印ubi init err 22
  • ¥20 PDF元数据中的XMP媒体管理属性
  • ¥15 R语言中lasso回归报错
  • ¥15 网站突然不能访问了,上午还好好的
  • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
  • ¥15 semrush,SEO,内嵌网站,api
  • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
  • ¥15 振荡电路,ADS仿真