java.lang.IllegalStateException:找不到工厂javax.faces.application.ApplicationFactory的备份 [英] java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory

查看:141
本文介绍了java.lang.IllegalStateException:找不到工厂javax.faces.application.ApplicationFactory的备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将应用程序升级为使用javax.faces-2.2.4和primefaces-4.0 jars.从myeclipse将应用程序部署到weblogic后,出现以下错误:

I have upgraded application to use javax.faces-2.2.4 and primefaces-4.0 jars.After deploying my application to weblogic from myeclipse I am getting below error:

Jan 10, 2014 2:37:13 PM javax.faces.FactoryFinder$FactoryManager getFactory
SEVERE: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.
Jan 10, 2014 2:37:13 PM com.sun.faces.config.ConfigureListener contextDestroyed
SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1135)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:379)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:140)
    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:310)
    at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:482)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.EventsManager.notifyContextDestroyedEvent(EventsManager.java:200)
    at weblogic.servlet.internal.WebAppServletContext.destroy(WebAppServletContext.java:3225)
    at weblogic.servlet.internal.ServletContextManager.destroyContext(ServletContextManager.java:247)
    at weblogic.servlet.internal.HttpServer.unloadWebApp(HttpServer.java:461)
    at weblogic.servlet.internal.WebAppModule.destroyContexts(WebAppModule.java:1545)
    at weblogic.servlet.internal.WebAppModule.deactivate(WebAppModule.java:509)
    at weblogic.application.internal.flow.ModuleStateDriver$2.previous(ModuleStateDriver.java:387)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.ModuleStateDriver.deactivate(ModuleStateDriver.java:141)
    at weblogic.application.internal.flow.ScopedModuleDriver.deactivate(ScopedModuleDriver.java:206)
    at weblogic.application.internal.flow.ModuleListenerInvoker.deactivate(ModuleListenerInvoker.java:261)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$2.previous(DeploymentCallbackFlow.java:547)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:192)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.deactivate(DeploymentCallbackFlow.java:184)
    at weblogic.application.internal.BaseDeployment$2.previous(BaseDeployment.java:677)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:63)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
    at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:59)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

甚至没有调用ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext )方法

推荐答案

java.lang.IllegalStateException:找不到工厂javax.faces.application.ApplicationFactory的备份.

java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.

此异常的更常见原因之一是,webapp的运行时类路径被多个相互冲突/混淆的JSF API版本所污染.

One of more common causes of this exception is that the webapp's runtime classpath is polluted with multiple different JSF API versions which are colliding/confusing each other.

您的情况也可能如此. Weblogic本身已经附带了捆绑的JSF,但是您将随Webapp一起提供另一个.因此,有效地在Webapp的运行时类路径中得到了两个不同版本的JSF API.

This is likely also the case in your case. Weblogic itself already ships with JSF bundled, however you're supplying another one along with your webapp. So effectively you end up with two different versioned JSF APIs in the webapp's runtime classpath.

我不使用Weblogic,但是基本上您有2个选择:

I don't do Weblogic, but basically you have 2 options:

  1. 告诉Weblogic不要加载其捆绑的JSF,以便有效地仅加载webapp捆绑的JSF.
  2. 如果您打算升级Weblogic的捆绑JSF版本,请不要通过您的web应用程序进行升级,而应直接在Weblogic本身中进行升级.或者,如果所需的JSF API版本与服务器的Servlet版本不兼容(JSF 2.2需要Servlet 3.0),则可以将整个服务器升级到较新的版本.

请咨询其管理文档以获取线索.

Consult its admin documentation for clues.

这篇关于java.lang.IllegalStateException:找不到工厂javax.faces.application.ApplicationFactory的备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆