JspRender.setSupportActiveRecord(true)问题

这是个老项目,使用的是JF5.1.5版本,使用Tomcat启动时没问题,想去掉tomcat,使用Undertow.但启动时就报错了

Starting JFinal 5.1.5
Info: jfinal-undertow 3.5, undertow 2.2.24.Final, jvm 1.8.0_201
Exception in thread "main" java.lang.NoClassDefFoundError: javax/el/ELResolver
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at com.jfinal.server.undertow.hotswap.HotSwapClassLoader.loadClass(HotSwapClassLoader.java:93)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.jfinal.render.JspRender.<clinit>(JspRender.java:41)
	at com.zssoft.gas.config.GasWebConfig.configConstant(GasWebConfig.java:133)
	at com.jfinal.core.Config.configJFinal(Config.java:51)
	at com.jfinal.core.JFinal.init(JFinal.java:61)
	at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:64)
	at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)
	at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:86)
	at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:594)
	at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:559)
	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:601)
	at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:302)
	at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:280)
	at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:153)
	at com.zshsoft.application.Application.main(Application.java:19)
Caused by: java.lang.ClassNotFoundException: javax.el.ELResolver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.jfinal.server.undertow.hotswap.HotSwapClassLoader.loadClass(HotSwapClassLoader.java:83)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 27 more


评论区

JFinal

2024-12-07 11:11

undertow 默认不支持 jsp , 缺少 javax.el.ELResolver.java

将 jsp 换成 jfinal enjoy 试一下

北流家园网

2024-12-07 14:31

@JFinal 这个换不了呀,要改就要改几百个页面,差不多重新弄一个了。

JFinal

2024-12-07 15:57

@北流家园网

参考这两篇文章:
https://jfinal.com/share/1899
https://jfinal.com/share/1890

happyboy

2024-12-08 13:38

https://jfinal.com/doc/1-5 划到8、JSP 支持问题

北流家园网

2024-12-09 09:02

@happyboy Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/tomcat/InstanceManager has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
报这个提示了

happyboy

2024-12-14 05:16

@北流家园网 你的编译环境和运行环境貌似不一致

热门反馈

扫码入社