You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mark Struberg (JIRA)" <de...@myfaces.apache.org> on 2018/04/12 20:39:00 UTC

[jira] [Created] (MYFACES-4224) AnnotatedFlowConfigurator.configureAnnotatedFlows is broken

Mark Struberg created MYFACES-4224:
--------------------------------------

             Summary: AnnotatedFlowConfigurator.configureAnnotatedFlows is broken
                 Key: MYFACES-4224
                 URL: https://issues.apache.org/jira/browse/MYFACES-4224
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-372
    Affects Versions: 2.3.0, 2.2.12
            Reporter: Mark Struberg
            Assignee: Mark Struberg


When running MyFaces on Tomcat with any CDI container AnnotatedFlowConfigurator.configureAnnotatedFlows get's called way too early which leads to the following Exception:

{noformat}
Apr 12, 2018 4:00:55 PM org.apache.myfaces.webapp.AbstractFacesInitializer initFaces
SCHWERWIEGEND: An error occured while initializing MyFaces: It's not allowed to call getBeans(Type, Annotation...) before AfterBeanDiscovery
java.lang.IllegalStateException: It's not allowed to call getBeans(Type, Annotation...) before AfterBeanDiscovery
	at org.apache.webbeans.container.InjectableBeanManager.checkAfterBeanDiscoveryProcessed(InjectableBeanManager.java:423)
	at org.apache.webbeans.container.InjectableBeanManager.getBeans(InjectableBeanManager.java:129)
	at org.apache.myfaces.cdi.util.CDIUtils.lookup(CDIUtils.java:45)
	at org.apache.myfaces.flow.cdi.DefaultCDIFacesFlowProvider.getAnnotatedFlows(DefaultCDIFacesFlowProvider.java:52)
	at org.apache.myfaces.flow.impl.AnnotatedFlowConfigurator.configureAnnotatedFlows(AnnotatedFlowConfigurator.java:42)
	at org.apache.myfaces.config.FacesConfigurator.configureFlowHandler(FacesConfigurator.java:1672)
	at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:614)
	at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:416)
	at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:74)
	at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:172)
	at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:121)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4937)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

{noformat}


This happens because the CDI spec disallows to call BeanManager#getBeans() before the container is started (AfterDeploymentValidation and later)




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)