在Spring项目中使用Jfinal-undertow启动报错

在spring项目使用Jfinal-undertow后启动报错,异常堆栈如下,有没有人遇到过?

报错代码在spring里:


public static void setWebAppRootSystemProperty(ServletContext servletContext) throws IllegalStateException {
Assert.notNull(servletContext, "ServletContext must not be null");
String root = servletContext.getRealPath("/");
if (root == null) {
throw new IllegalStateException(
"Cannot set web app root system property when WAR file is not expanded");
}


java.lang.RuntimeException: java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:253)
at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:152)
at com.platform.PlatformApplication.main(PlatformApplication.java:24)
Caused by: java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:155)
at org.springframework.web.util.WebAppRootListener.contextInitialized(WebAppRootListener.java:57)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
... 3 more


评论区

JFinal

2019-02-18 16:21

jfinal undertow 是专门支持 jfinal 项目开发的,不支持 spring

学而不思则罔

2019-02-18 16:34

@JFinal 知道了,我是参考http://www.jfinal.com/share/1309做的遇到问题了。

快乐的蹦豆子

2019-02-18 18:10

spring boot有自己的undertow

热门反馈

扫码入社