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

时间:2014-01-10 09:30:49

标签: jsf weblogic jsf-2.2

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

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 )方法

2 个答案:

答案 0 :(得分:4)

  

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

此异常的一个常见原因是webapp的运行时类路径被多个不同的JSF API版本污染,这些版本相互冲突/混淆。

在您的情况下也可能是这种情况。 Weblogic本身已经捆绑了JSF,但是你要提供另一个以及你的webapp。因此,您可以在webapp的运行时类路径中最终获得两个不同版本的JSF API。

我不做Weblogic,但基本上你有两个选择:

  1. 告诉Weblogic不加载其捆绑的JSF,因此实际上只加载了webapp-bundled JSF。
  2. 如果您打算升级Weblogic捆绑的JSF版本,请不要通过您的webapp升级,而是直接在Weblogic本身升级。或者,如果所需的JSF API版本与服务器的Servlet版本不兼容(JSF 2.2需要Servlet 3.0),则可以将整个服务器升级到更新的版本。
  3. 查阅其管理文档以获取线索。

答案 1 :(得分:2)

您只需要清理构建并在weblogic上部署这个新版本