本文介紹了Tomcat 8.5 el-API上的Spring遷移4.3到5錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在Tomcat 8.5上使用Spring Boot初始化器將Spring4.3升級到5時,我們開始收到異常:
2021-06-06 12:37:50,482 DEBUG [background-preinit] messageinterpolation.ResourceBundleMessageInterpolator (ResourceBundleMessageInterpolator.java:220) - Failed to load expression factory via classloader ParallelWebappClassLoader
context: ROOT
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@76f856a8
javax.el.ELException: Unable to find ExpressionFactory of type [# Licensed to the Apache Software Foundation (ASF) under one or more]
at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:154) ~[el-api.jar:3.0.FR]
at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:93) ~[el-api.jar:3.0.FR]
at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.canLoadExpressionFactory(ResourceBundleMessageInterpolator.java:216) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.buildExpressionFactory(ResourceBundleMessageInterpolator.java:170) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.<init>(ResourceBundleMessageInterpolator.java:94) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.getDefaultMessageInterpolator(AbstractConfigurationImpl.java:573) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.getDefaultMessageInterpolatorConfiguredWithClassLoader(AbstractConfigurationImpl.java:822) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.getMessageInterpolator(AbstractConfigurationImpl.java:483) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.<init>(ValidatorFactoryImpl.java:153) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.hibernate.validator.internal.engine.AbstractConfigurationImpl.buildValidatorFactory(AbstractConfigurationImpl.java:451) [hibernate-validator-6.2.0.Final.jar:6.2.0.Final]
at org.springframework.boot.autoconfigure.BackgroundPreinitializer$ValidationInitializer.run(BackgroundPreinitializer.java:149) [spring-boot-autoconfigure-2.5.0.jar:2.5.0]
at org.springframework.boot.autoconfigure.BackgroundPreinitializer$1.runSafely(BackgroundPreinitializer.java:111) [spring-boot-autoconfigure-2.5.0.jar:2.5.0]
at org.springframework.boot.autoconfigure.BackgroundPreinitializer$1.run(BackgroundPreinitializer.java:102) [spring-boot-autoconfigure-2.5.0.jar:2.5.0]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.ClassNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1358) ~[catalina.jar:8.5.50]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180) ~[catalina.jar:8.5.50]
at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:147) ~[el-api.jar:3.0.FR]
... 14 more
el-api jar取自tomcat/lib,我們還將el-API版本從2更改為3,但仍拋出異常
是否有此例外的已知解決方案?
可以忽略它嗎?
我發(fā)現(xiàn)related bug無法修復
EPEL EL6于2020-11-30更改為報廢(EOL)狀態(tài)。埃佩爾E6是
不再維護,這意味著它將不會再收到任何
安全或錯誤修復更新。因此,我們將關閉此錯誤。
推薦答案
您偶然發(fā)現(xiàn)了錯誤64097:未跳過META-INF/services/javax.el.ExpressionFactory
文件中的注釋,因此出現(xiàn)奇怪的錯誤。
此問題已在Tomcat版本8.5.51和9.0.31中修復。
這篇關于Tomcat 8.5 el-API上的Spring遷移4.3到5錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,