spring整合mybatis采坑

本來這個錯誤是整合spring和mybatis遇到的錯誤,但是一直沒有解決,但是在做SpringMVC時也了出現了這樣的錯誤

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext-mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object;


at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:742)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at test.<init>(test.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.platform.commons.util.ReflectionUtils.newInstance(ReflectionUtils.java:347)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:60)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:197)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateAndPostProcessTestInstance(ClassTestDescriptor.java:188)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$1(ClassTestDescriptor.java:181)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:80)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:57)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:60)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$null$2(HierarchicalTestExecutor.java:92)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:92)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$null$2(HierarchicalTestExecutor.java:92)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.lambda$execute$3(HierarchicalTestExecutor.java:92)
at org.junit.platform.engine.support.hierarchical.SingleTestExecutor.executeSafely(SingleTestExecutor.java:66)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:77)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:51)
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:43)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:65)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.NoSuchMethodError: org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object;
at org.springframework.context.event.AbstractApplicationEventMulticaster.addApplicationListener(AbstractApplicationEventMulticaster.java:105)
at org.springframework.context.support.AbstractApplicationContext.addApplicationListener(AbstractApplicationContext.java:494)
at org.springframework.context.support.ApplicationListenerDetector.postProcessAfterInitialization(ApplicationListenerDetector.java:78)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:423)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
... 60 more


這個錯誤造成的主要原因是pom.xml、中多了一個spring-aop的依賴造成的。




轉載于:https://www.cnblogs.com/huangzhe1515023110/p/9276070.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390274.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390274.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390274.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

處理測試環境硬盤爆滿

測試環境經常會收到這類告警 第一步 登陸機器查看硬盤使用 執行df 好吧,使用情況真不妙,根目錄占用過大 第二步 確定哪個文件太大或者文件過多 進入爆滿的目錄,如這里是根目錄 cd / 然后找下面哪個文件夾或者文件太大,有幾種方式: 1.dusudo du -h --max-depth1 | sort -hr 越前…

LeetCode-46. Permutations

一、問題描述 就是全排列問題。 二、問題解決 應該哪一本數據結構的書上都有講了。 void get_permute(vector<int>& nums, int pos, vector<vector<int>>& result) {if (nums.size() pos) {result.push_back(nums);return;}for (int i pos; i <…

web操作系統開發的_哪種操作系統更適合Web開發

web操作系統開發的If youre new to web development and are in the market for a new laptop, you might be wondering which operating system is best.如果您是Web開發的新手&#xff0c;并且正在購買新的筆記本電腦&#xff0c;您可能想知道哪種操作系統是最好的。 Spoile…

白鷺引擎 - 顯示對象的基準點與橫縱坐標 ( 繪制一個來回移動的綠色方塊 )

class Main extends egret.DisplayObjectContainer {/** * Main 類構造器, 初始化的時候自動執行, ( 子類的構造函數必須調用父類的構造函數 super )* constructor 是類的構造函數, 類在實例化的時候調用* egret.Event.ADDED_TO_STAGE, 在將顯示對象添加到舞臺顯示列表時調度*/…

SpringBoot項目屬性配置

我們知道&#xff0c;在項目中&#xff0c;很多時候需要用到一些配置的東西&#xff0c;這些東西可能在測試環境和生產環境下會有不同的配置&#xff0c;后面也有可能會做修改&#xff0c;所以我們不能在代碼中寫死&#xff0c;要寫到配置中。我們可以把這些內容寫到applicatio…

670. 最大交換

670. 最大交換 給定一個非負整數&#xff0c;你至多可以交換一次數字中的任意兩位。返回你能得到的最大值。 示例 1 : 輸入: 2736 輸出: 7236 解釋: 交換數字2和數字7。 示例 2 : 輸入: 9973 輸出: 9973 解釋: 不需要交換。 解題思路 目標就是優先鎖定高位&#xff0c;像…

flexbox布局_Flexbox vs Grid-如何構建最常見HTML布局

flexbox布局There are so many great CSS resources all over the internet. But what if you just want a simple layout and you want it NOW? 互聯網上有很多很棒CSS資源。 但是&#xff0c;如果您只是想要一個簡單的布局而現在就想要呢&#xff1f; In this article, I d…

789. 逃脫阻礙者

789. 逃脫阻礙者 你在進行一個簡化版的吃豆人游戲。你從 [0, 0] 點開始出發&#xff0c;你的目的地是 target [xtarget, ytarget] 。地圖上有一些阻礙者&#xff0c;以數組 ghosts 給出&#xff0c;第 i 個阻礙者從 ghosts[i] [xi, yi] 出發。所有輸入均為 整數坐標 。 每一…

計算機視覺-自定義對象檢測器

1、模板匹配 運行指令&#xff1a;python template_matching.py --source 3.jpg --template 2.jpg import argparse import cv2ap argparse.ArgumentParser() ap.add_argument("-s", "--source", requiredTrue, help"Path to the source image"…

Java 微信公眾號導出所有粉絲(openId)

由于公眾號換了公司主體&#xff0c;需要做遷移&#xff0c;玩家的openId數據需要做處理。 (我是按我要的json格式&#xff0c;將粉絲導成了1萬條數據的一個json文件) 文件格式&#xff1a; {"info":[{"openId":"ogVous494ltuNmO4zHb1seHeGLSk"}…

javascript閉包_JavaScript閉包教程–帶有JS閉包示例代碼

javascript閉包Closures – many of you JavaScript devs have probably heard this term before. When I started my journey with JavaScript, I encountered closures often. And I think theyre one of the most important and interesting concepts in JavaScript. 閉包–…

1646. 獲取生成數組中的最大值

1646. 獲取生成數組中的最大值 給你一個整數 n 。按下述規則生成一個長度為 n 1 的數組 nums &#xff1a; nums[0] 0 nums[1] 1 當 2 < 2 * i < n 時&#xff0c;nums[2 * i] nums[i] 當 2 < 2 * i 1 < n 時&#xff0c;nums[2 * i 1] nums[i] nums[i …

docker保存日志文件到本地

其實很簡單 docker logs 你需要添加的額外參數 容器id >文件名稱 然后查看這個文件就可以了&#xff0c;也可以通過ftp協議下載到本地

防反射JavaScript –如何讓您的JS等待

Debounce methods do not execute when invoked. Instead, they wait for a predetermined time before executing. If the same method is called again, the previous is cancelled and the timer restarts.防抖動方法在調用時不執行。 而是&#xff0c;它們在執行之前等待預…

21天學通Visual.Basic pdf

下載地址&#xff1a;網盤下載《21天學通Visual Basic(第2版)》是Visual Basic 6.0的入門教程&#xff0c;主要針對沒有程序設計基礎的讀者&#xff0c;詳細介紹了Visual Basic 6.0的基本概念和編程技術。書中通過大量的范例及綜合練習來介紹Visual Basic 6.0的基本概念、語言特…

297. 二叉樹的序列化與反序列化

297. 二叉樹的序列化與反序列化 序列化是將一個數據結構或者對象轉換為連續的比特位的操作&#xff0c;進而可以將轉換后的數據存儲在一個文件或者內存中&#xff0c;同時也可以通過網絡傳輸到另一個計算機環境&#xff0c;采取相反方式重構得到原數據。 請設計一個算法來實現…

交互式圖表_如何構建羅馬數字轉換器和交互式羅馬數字圖表

交互式圖表The Roman numerals are no longer an essential part of our daily lives. But we do use them when designing monuments, clocks, and even for sporting events.羅馬數字不再是我們日常生活中必不可少的部分。 但是我們在設計紀念碑&#xff0c;鐘表甚至體育賽事…

Python 08 面向對象

Python 面向對象 1、編程范式 2、面向對象特性 3、屬性、方法 4、三大特性 5、高級方法 6、類的特殊成員方法 7、反射 8、異常處理 9、單例模式 一、編程范式 編程&#xff1a;程序員用特定的語法數據結構算法組成的代碼來告訴計算機如何執行任務的過程 &#xff0c; 實現一個…

eclipse手動添加SVN插件

https://www.cnblogs.com/hcl1991/p/5888461.html 1.手動下載svn插件&#xff08;百度SVNsite-1.8.18&#xff09; 2.將下載好的SVNsite-1.8.18.zip 解壓 3.在eclipse安裝目錄的plugins新建SVN文件夾 4.將SVNsite-1.8.18解壓包下的features和plugins拷貝到新建的SVN文件夾下 5.…

440. 字典序的第K小數字

440. 字典序的第K小數字 給定整數 n 和 k&#xff0c;找到 1 到 n 中字典序第 k 小的數字。 注意&#xff1a;1 ≤ k ≤ n ≤ 109。 示例 : 輸入: n: 13 k: 2 輸出: 10 解釋: 字典序的排列是 [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9]&#xff0c;所以第二小的數字是…