jfinal 4.4 Undertow访问报错

2019-09-18 09:08:57

[WARN]-[Thread: XNIO-1 task-4]-[com.jfinal.core.ActionHandler.handle()]: 404 Action Not Found: /


2019-09-18 09:08:57

[ERROR]-[Thread: XNIO-1 task-4]-[io.undertow.servlet.api.LoggingExceptionHandler.handleThrowable()]: UT005023: Exception handling request to /

java.lang.NoClassDefFoundError: Could not initialize class com.jfinal.render.JspRender

at com.jfinal.render.RenderFactory$JspRenderFactory.getRender(RenderFactory.java:205)

at com.jfinal.render.RenderFactory.getRender(RenderFactory.java:67)

at com.jfinal.render.ErrorRender.render(ErrorRender.java:51)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:69)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)


评论区

你妹啊

2019-09-18 09:13

解决办法:到apache-tomcat/lib目录下,拷贝el-api.jar放到D:\Java\jdk1.6.0_11\jre\lib\ext下即可,和这没有关系吧

chcode

2019-09-18 09:22

undertow默认不支持jsp,需要引入额外依赖

你妹啊

2019-09-18 09:28

缺少maven依赖吗?

JFinal

2019-09-18 09:40

@你妹啊 jfinal undertow 不支持 JSP, 改用 jetty-server 进行开发:
https://www.jfinal.com/doc/1-6

部署用 tomcat:
https://www.jfinal.com/doc/1-7

JSP 太古老了,建议换用 jfinal enjoy 引擎,爽得不得了

你妹啊

2019-09-18 09:48

已经解决,谢谢

山东小木

2019-09-19 10:13

@你妹啊 分享一下解决思路吧

你妹啊

2019-09-20 17:41

@山东小木 这个启动是成功的,报这个错是因为访问的路径不存在。如果路径存在的话就正常访问了

热门反馈

扫码入社