Jfinal 改用Undertow后,不能通过集成类实现IRenderFactory

今天按官方文档,把项目改成Undertow运行,启动发现Beetl报错

Exception in thread "main" java.lang.IncompatibleClassChangeError: Class org.beetl.ext.jfinal3.JFinal3BeetlRenderFactory does not implement the requested interface com.jfinal.render.IRenderFactory
at com.jfinal.render.RenderManager.init(RenderManager.java:72)
at com.jfinal.core.JFinal.initRender(JFinal.java:98)
at com.jfinal.core.JFinal.init(JFinal.java:66)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:62)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:589)
at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:554)
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.start(DeploymentManagerImpl.java:596)
at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:270)
at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:248)
at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:146)
at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:80)
at com.demo.common.DemoConfig.main(DemoConfig.java:35)


看了一下,应该是改造后,JFinal3BeetlRenderFactory通过继承类RenderFactory实现IRenderFactory接口就不认了。

public class JFinal3BeetlRenderFactory extends RenderFactory {
  ...
}

public class RenderFactory implements IRenderFactory {
 ...
}


不知道为什么造成这种情况,有没有什么办法解决?

评论区

JFinal

2018-12-15 15:13

UndertowServer.create(...)
.addHotSwapClassPrefix("org.beetl.")
.start();

即可打完收工

热门反馈

扫码入社