時,基於註釋/ java配置的應用程序開始尋找xml配置文件我的spring java-config應用程序打包爲war,但運行weblogic 12.1.3時沒有問題我試圖將相同的戰爭部署到weblogic 12.2.1,它導致了java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/DispatcherServlet-servlet.xml]
。 即使在戰爭是相同的情況下,DispatcherServlet servlet在12.2.1中似乎也被初始化爲XmlWebApplicationContext
(默認值)而不是AnnotationConfigEmbeddedWebApplicationContext
。 有沒有人知道什麼是以前版本的weblogic實現中發生了什麼變化是什麼導致了這個問題?當從weblogic12c(12.1.3)移動到weblogic12cR2(12.2.1)
使用相同war
:
- 在WLS 12.1.3它的工作沒有問題,應用程序配置使用註釋/ JAVA
- 在WLS 12.2.1同一應用程序在某些時候會查找XML配置,而不是在12.1.3中使用annotations/java進行配置。
我不能得到這個工作。獲取以下錯誤「無法初始化上下文,因爲已經存在根應用程序上下文 - 請檢查您的web.xml中是否有多個ContextLoader *定義!」。這個方法與Spring已經提供的方法有什麼不同? – Kristoffer
@Kristoffer,好吧,不知道,但我想你實際上有多個上下文定義? Spring提供了三種方法來執行我在我的答案中描述的基於註釋的配置,但其中只有兩種適用於WebLogic 12c:我正在使用或使用Spring Boot。所以... :) – amariq