首页 > 解决方案 > 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,同样的故事。

标签: javamyfaces

解决方案


这是启动项目的正确方法,将 myfaces 依赖项 jar 放在服务器容器中的之前:

weblogic-prefer-application-packages-not-working

JBoss 的简单部署描述符可能会完成相同的任务。


推荐阅读