微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

EAP 7.3: java.lang.ClassNotFoundException: # 授权给 Apache Software Foundation (ASF) 一个或多个 - 仅在独立模式下

如何解决EAP 7.3: java.lang.ClassNotFoundException: # 授权给 Apache Software Foundation (ASF) 一个或多个 - 仅在独立模式下

我们有一个 web 应用程序 (war) 在域模式下成功部署到 JBoss EAP 7.3(使用配置文件),但是在独立模式下部署(基于认的 standalone.xml 配置)它失败了:

14:47:40,342 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 88) MSC000001: Failed to start service jboss.deployment.unit."app.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."app.war".undertow-deployment: java.lang.RuntimeException: javax.el.ELException: Provider # Licensed to the Apache Software Foundation (ASF) under one or more not found
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossthread.run(JBossthread.java:485)
Caused by: java.lang.RuntimeException: javax.el.ELException: Provider # Licensed to the Apache Software Foundation (ASF) under one or more not found
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:254)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
        ... 8 more
Caused by: javax.el.ELException: Provider # Licensed to the Apache Software Foundation (ASF) under one or more not found
        at javax.el.FactoryFinder.newInstance(FactoryFinder.java:64)
        at javax.el.FactoryFinder.find(FactoryFinder.java:103)
        at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:140)
        at javax.el.ELUtil.getExpressionFactory(ELUtil.java:185)
        at javax.el.ELManager.getExpressionFactory(ELManager.java:38)
        at org.apache.jasper.runtime.JspApplicationContextImpl.<init>(JspApplicationContextImpl.java:49)
        at org.apache.jasper.runtime.JspApplicationContextImpl.getInstance(JspApplicationContextImpl.java:78)
        at org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:218)
        at org.wildfly.extension.undertow.deployment.JspInitializationListener.contextinitialized(JspInitializationListener.java:51)
        at io.undertow.servlet.core.ApplicationListeners.contextinitialized(ApplicationListeners.java:187)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:217)
        at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:186)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504)
        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
        ... 10 more
Caused by: java.lang.classNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more from [Module "deployment.app.war" from Service Module Loader]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
        at org.jboss.modules.ConcurrentClassLoader.performloadClassUnchecked(ConcurrentClassLoader.java:410)
        at org.jboss.modules.ConcurrentClassLoader.performloadClass(ConcurrentClassLoader.java:398)
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
        at javax.el.FactoryFinder.newInstance(FactoryFinder.java:48)
        ... 29 more

14:47:40,351 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") Failed - address: ([("deployment" => "app.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"app.war\".undertow-deployment" => "java.lang.RuntimeException: javax.el.ELException: Provider # Licensed to the Apache Software Foundation (ASF) under one or more not found
    Caused by: java.lang.RuntimeException: javax.el.ELException: Provider # Licensed to the Apache Software Foundation (ASF) under one or more not found
    Caused by: javax.el.ELException: Provider # Licensed to the Apache Software Foundation (ASF) under one or more not found
    Caused by: java.lang.classNotFoundException: # Licensed to the Apache Software Foundation (ASF) under one or more from [Module \"deployment.app.war\" from Service Module Loader]"}}

战争和应用程序配置在这两种情况下是相同的。

JBoss 配置在两种情况下都尽可能接近。在域模式下,它基于配置文件,基本上只添加了一些资源。在独立模式下,它基于认的 standalone.xml 并添加了相同的资源集。因此,从这个角度来看,我找不到行为差异的任何原因。

到目前为止,我们已经将其跟踪到 tomcat-embed-el-9.0.39.jar,由于某些 3rd 方依赖性,它包含在我们的战争中。此 jar 包含具有以下内容meta-inf/services/javax.el.ExpressionFactory

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License,Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,software
# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

org.apache.el.ExpressionFactoryImpl

问题显然是第一行作为实际条目(例如类名)被读取和处理,即使它只是一个注释。 因此,它类似于影响 EAP 6 的以下旧问题: https://access.redhat.com/solutions/1270603(需要红帽登录)。

奇怪的是,这仅发生在独立模式下。 这会被认为是一个错误吗?

注意:我们在 JBoss EAP 7.3.0 和 7.3.6 上对此进行了测试,结果相同。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。