java - MyFaces 基础项目无法启动
问题描述
我正在尝试启动在这里找到的一个非常基本的项目:
带有 Myfaces 的 JSF 2.2 的 HelloWorld 示例
刚刚从这里克隆了 git 。
现在,我尝试了不同的方法,但无法修改我的 App Server 中的 JSF Mojarra 共存,因为我认为这个问题:
<27-ott-2018 23.44.46,046 CEST> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application "jsf_myfaces" on [partition-name: DOMAIN].>
<27-ott-2018 23.44.46,048 CEST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application "jsf_myfaces".>
<27-ott-2018 23.44.46,048 CEST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.application.ModuleException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:561)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getApplication(FacesContextImplBase.java:169)
at org.apache.myfaces.context.servlet.FacesContextImplBase.getELContext(FacesContextImplBase.java:231)
at javax.faces.component.UIViewRoot.setLocale(UIViewRoot.java:1488)
Truncated. see log file for complete stacktrace
只是与此有关。试过 JBoss Wildfly 8.2 和 Weblogic 12c R2,同样的故事。
解决方案
这是启动项目的正确方法,将 myfaces 依赖项 jar 放在服务器容器中的之前:
weblogic-prefer-application-packages-not-working
JBoss 的简单部署描述符可能会完成相同的任务。
推荐阅读
- css - 为什么在使用 camelCase 时 PurgeCSS 会清除导入的 SASS 样式?
- s2 - 5km距离内点的精度
- c++ - 如何制作一个可拖动的 GTK 小部件,将文件拖放到其他程序中
- python - 如何在 if 条件中引用多个变量
- python - Probelm 与 Django manage.py runserver 提供错误
- sql - 每个周期范围 SQL 的新列中的总计
- android - 如何在 Kotlin 中展开和折叠 TextView 后恢复布局位置
- javascript - 未定义 OverlappingMarkerSpiderfier (Vue.js)
- python - 使用 numpy 提取 glcm 矩阵
- php - 计算数组中 n 个事件的并集概率