關於Spring提示java.lang.IllegalStateException: Failed to load ApplicationContext問題解決
學習中遇到了Spring報如下錯誤
java.lang.IllegalStateException: Failed to load ApplicationContext
細究其原因:
Caused by: org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 73; cvc-complex-type.2.4.c: 萬用字元的匹配很全面, 但無法找到元素 'tx:advice' 的宣告。
出現Failed to load ApplicationContext的原因一般都是xml document文件出現不同程度的配置錯誤,既然提示無法找到tx:advice標籤,肯定是匯入約束時的約束未起作用
Spring有個細節:在Spring啟動時,會按照xml中的標頭檔案來校驗配置中的標籤,當碰到不能識別的標籤後,Spring會報第一條錯誤
在eclipse中要手動匯入約束,而在idea中的maven工程下,只需要將約束的地址放在標頭檔案即可,IDE 會幫助我們直接引用.
推薦:最好用工具的提示快捷鍵(Alt+Enter) 來自動匯入約束檔案,因為筆者本人也吃過手動貼上約束檔案粘錯的虧
最好的標頭檔案 貼上好後(標頭檔案中的約束三條是一整套)
:
相關推薦
關於Spring提示java.lang.IllegalStateException: Failed to load ApplicationContext問題解決
學習中遇到了Spring報如下錯誤 java.lang.IllegalStateException: Failed to load ApplicationContext 細究其原因: Caused by: org.xml.sax.SAXParseException;
java.lang.IllegalStateException: Failed to load ApplicationContext 解決辦法思考
一般情況出現這個情況 為xml配置錯誤 (分析在文章末尾)目前我的錯誤提示如下:注意看caused by 的具體內容java.lang.IllegalStateException: Failed to load ApplicationContextat org.spring
java.lang.IllegalStateException: Failed to load ApplicationContext
error for IT location method 錯誤 int pac 博客 java Spring AOP編寫MAVEN項目,編譯時出現錯誤提示如下: java.lang.IllegalStateException: Failed to load Applicat
java.lang.IllegalStateException: Failed to load ApplicationContext(2)
def tin TE lac ava .com nco tex 連接 錯誤提示:java.lang.IllegalStateException: Failed to load ApplicationContext Caused by: org.springframework
【application.yml配置問題】java.lang.IllegalStateException: Failed to load ApplicationContext
我在springboot中遇到的錯如下: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAw
java.lang.IllegalStateException: Failed to load ApplicationContext錯誤解決
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoa
Junit4測試錯誤解決java.lang.IllegalStateException: Failed to load ApplicationContext
2013-09-22 15:51:42,000 ERROR (org.springframework.test.context.TestContextManager:315) - Caught exception while allowing TestExecutionLi
java.lang.IllegalStateException: Failed to load property source from location
在學習springcloud的config客戶端通過config服務端讀取github檔案時遇到了如下問題 2018-11-12 16:45:34.567 ERROR 1312 --- [on(2)-127.0.0.1] o.s.boot.SpringApplication
maven單元測試報java lang IllegalStateException Failed to load Ap
從網上查了兩個原因: 1.報這個異常java.lang.IllegalStateExcepti
java.lang.IllegalStateException: Failed to load property source from location 'classpath:/application-dev.yml'
如果你的專案沒有配置錯誤,配置檔名稱也正常,還出現這個問題,那一定是你的yml檔案編碼的問題 先附上一張專案架構圖 當我啟動伺服器尋找配置檔案的時候,伺服器提示這樣的錯誤資訊 java.lang.IllegalStateException: Failed to load property so
IDEA 啟動報錯:java.lang.IllegalStateException: failed to create a child event loop 問題解決
遇到的問題 昨天電腦自動更新了,今天死活啟動不了專案,看到idea的提示是: idea日誌如下 根據提示說 檢視idea的啟動日誌: 2018-11-20 17:35:42,010 [ 46737] INFO - plication.impl.Applicat
Springboot jar 部署java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/li
Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/byte-buddy-1.7.11.jar at
Java 條碼生成庫 Barcode4J Maven 依賴缺失錯誤 java.lang.IllegalStateException: Failed to introspect Class
前段時間專案中需要生成商品條碼,使用 Barcode4J 庫實現的,直接使用了內部的 BarcodeServlet ,僅在 Spring MVC 的 Controller 裡簡單的封裝了下提供個訪問路徑,使用上沒有遇到任何問題。程式碼如下: import jav
Allocate exception for servlet springmvc java.lang.IllegalStateException: Failed to check the status
品優購異常資訊 嚴重: Allocate exception for servlet springmvc java.lang.IllegalStateException: Failed to check the status of the service com.pinyougou.pa
netty使用epoll報錯:java.lang.UnsatisfiedLinkError: failed to load the required native library
Caused by: java.lang.UnsatisfiedLinkError: could not load a native library: netty_transport_native_epoll_x86_64 最近修改moquette程式碼, NettyAcc
解決IllegalStateException: Failed to load ApplicationContext 方法
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
用idea+maven編譯打包spark project core錯誤:java.lang.RuntimeException: Unable to load a Suite class
ide exception 5-0 sco anon time arp create run Discovery starting. *** RUN ABORTED *** java.lang.RuntimeException: Unable to load a Su
java.lang.IllegalArgumentException: Failed to find configured root that contains .....
參考文章:FileProvider 的使用 今天寫到相機拍照,報出如下異常: java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Androi
spring boot:java.lang.IllegalStateException異常
1、單元測試報錯: java.lang.IllegalStateException: Could not load TestContextBootstrapper [null]. Specify @BootstrapWith's 'value' attribute or make t
Centos7與Fedora24安裝mysql後無法啟動,提示 Unit mysql.service failed to load:No such file or directory
Centos7與Fedora24安裝mysql後無法啟動,提示 Unit mysql.service failed to load:No such file or directory [r