0 Replies Latest reply on Dec 10, 2018 5:45 AM by Ralf Battenfeld

    Wildfly 14/15: Unable to deploy JSF app - UT010042: This method cannot be called from a servlet context listener that has been added programatically

    Ralf Battenfeld Apprentice

      Hi

       

      I am trying to migrate our frontend app based on JSF from wildfly 10.1.0 to Wildfly 14 or 15. On deployment, I get this errors:

       

      11:03:04,142 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 108) Initializing Mojarra 2.3.5.SP2 for context '/our-web'

      11:03:07,857 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 108) Critical error during deployment: : java.lang.UnsupportedOperationException: UT010042: This method cannot be called from a servlet context listener that has been added programatically

      at io.undertow.servlet.spec.ServletContextImpl.ensureNotProgramaticListener(ServletContextImpl.java:961)

      at io.undertow.servlet.spec.ServletContextImpl.getServletRegistrations(ServletContextImpl.java:584)

      at com.sun.faces.util.Util.getExistingFacesServletRegistration(Util.java:175)

      at com.sun.faces.util.Util.getFacesServletMappings(Util.java:165)

      at com.sun.faces.util.Util.isResourceExactMappedToFacesServlet(Util.java:997)

      at com.sun.faces.util.Util.isViewIdExactMappedToFacesServlet(Util.java:978)

      at com.sun.faces.application.view.FaceletViewHandlingStrategy.handlesViewId(FaceletViewHandlingStrategy.java:981)

      at com.sun.faces.application.view.ViewHandlingStrategyManager.getStrategy(ViewHandlingStrategyManager.java:100)

      at com.sun.faces.application.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:71)

      at com.sun.faces.application.view.MultiViewHandler.getViewDeclarationLanguage(MultiViewHandler.java:470)

      at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:340)

      at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:340)

      at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:340)

      at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.processEvent(ApplicationAssociate.java:347)

      at javax.faces.event.SystemEvent.processListener(SystemEvent.java:147)

      at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2292)

      at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2265)

      at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:344)

      at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:761)

      at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:709)

      at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:293)

      at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)

      at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)

      at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)

      at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)

      at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

      at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)

      at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)

      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

      at java.util.concurrent.FutureTask.run(FutureTask.java:266)

      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)

      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)

      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)

      at java.lang.Thread.run(Thread.java:748)

      at org.jboss.threads.JBossThread.run(JBossThread.java:485)

       

      I tried to debug it but I could only see that com.sun.faces.config.ConfigureListener has the 'isProgrammatic' flag.

      I also tried to activate older JSF versions via jboss-deployment-structure.xml but I couldn't. The documentation for Wildfly 14 gives an example but this fails as well.

       

      I guess I have to configure something or exclude some libs.

       

      Can someone tell me how to go further? Unfortunately, the error message doesn't really help and should be improved to say which method is the issue.

       

      I quickly tested Wildfly 13, and here the deployment is successful.

      Thanks,

      Ralf