spring boot java。lang.IllegalStateException:未找到WebApplicationContext:未找到ContextLoaderListener或DispatcherServlet注册错误
我在这个项目中使用Spring、Gradle和Tomcatrunwar,我一直面临这个错误。。我在网上尝试过不同的解决方案,但都没有效果。我最近才加入这个项目,我对servelets还比较陌生 我的网络。xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="fineract-platform-provider" version="3.0">
<display-name>Fineract Platform</display-name>
<filter>
<filter-name>filterChainProxy</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
<filter-name>filterChainProxy2</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
<filter-name>filterChainProxy3</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>filterChainProxy</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>filterChainProxy2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>filterChainProxy3</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<description>A provider of microfinance services which applications can
consume once authenticated and authorized.</description>
<!-- =========================================================================
web.xml is no longer used since the switch to Spring Boot.
org.apache.fineract.infrastructure.core.boot.war.WebApplicationInitializerConfiguration
and org.apache.fineract.infrastructure.core.boot.WebXmlConfiguration take its place now.
=========================================================================
-->
<absolute-ordering/>
</web-app>```
I don't have a applicationContext.xml in my project, the IDE creates the spring application context and I can't access the file. So adding a listener for the ContextLoader points that out in a new error,
What can I do, please advice
# 1 楼答案
我添加了侦听器并创建了applicationContext。来自现有appContext的xml。xml在/META-INF/Spring文件夹中,但当我尝试gradlew tomCatRunWar任务时,会产生一系列新错误 应用程序上下文。xml
网络。xml