When the following setting is defined in web.xml for JSF application:
<context-param> <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name> <param-value>*.jsp</param-value> </context-param>
JSF deployment fails with "UnsupportedOperationException: UT010042: This method cannot be called from a servlet context listener that has been added programmatically"
SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 84) 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:976) at io.undertow.servlet.spec.ServletContextImpl.getServletRegistrations(ServletContextImpl.java:584) at com.sun.faces.util.Util.getExistingFacesServletRegistration(Util.java:160) at com.sun.faces.util.Util.getFacesServletMappings(Util.java:150) at com.sun.faces.util.Util.isResourceExactMappedToFacesServlet(Util.java:1158) at com.sun.faces.util.Util.isViewIdExactMappedToFacesServlet(Util.java:1139) at com.sun.faces.application.view.FaceletViewHandlingStrategy.handlesViewId(FaceletViewHandlingStrategy.java:946) at com.sun.faces.application.view.ViewHandlingStrategyManager.getStrategy(ViewHandlingStrategyManager.java:76) at com.sun.faces.application.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:47) at com.sun.faces.application.view.MultiViewHandler.getViewDeclarationLanguage(MultiViewHandler.java:446) at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:346) at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:346) at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.processEvent(ApplicationAssociate.java:324) at javax.faces.event.SystemEvent.processListener(SystemEvent.java:123) at com.sun.faces.application.applicationimpl.Events.processListeners(Events.java:253) at com.sun.faces.application.applicationimpl.Events.invokeListenersFor(Events.java:231) at com.sun.faces.application.applicationimpl.Events.publishEvent(Events.java:112) at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:127) at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788) at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:553) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:264) at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187) at io.undertow.servlet.core.DeploymentManagerImpl.call(DeploymentManagerImpl.java:217) at io.undertow.servlet.core.DeploymentManagerImpl.call(DeploymentManagerImpl.java:186) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction.call(ServletRequestContextThreadSetupAction.java:42) at io.undertow.servlet.core.ContextClassLoaderSetupAction.call(ContextClassLoaderSetupAction.java:43) at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create(SecurityContextThreadSetupAction.java:105) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.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:1982) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.lang.Thread.run(Thread.java:748) at org.jboss.threads.JBossThread.run(JBossThread.java:491) ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 84) MSC000001: Failed to start service jboss.deployment.unit."tasks-jsf.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."tasks-jsf.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.UnsupportedOperationException: UT010042: This method cannot be called from a servlet context listener that has been added programatically at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:81) 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:1982) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at java.lang.Thread.run(Thread.java:748) at org.jboss.threads.JBossThread.run(JBossThread.java:491) Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.UnsupportedOperationException: UT010042: This method cannot be called from a servlet context listener that has been added programatically at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:254) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:78) ... 8 more Caused by: java.lang.RuntimeException: java.lang.UnsupportedOperationException: UT010042: This method cannot be called from a servlet context listener that has been added programatically at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:283) at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187) at io.undertow.servlet.core.DeploymentManagerImpl.call(DeploymentManagerImpl.java:217) at io.undertow.servlet.core.DeploymentManagerImpl.call(DeploymentManagerImpl.java:186) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction.call(ServletRequestContextThreadSetupAction.java:42) at io.undertow.servlet.core.ContextClassLoaderSetupAction.call(ContextClassLoaderSetupAction.java:43) at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create(SecurityContextThreadSetupAction.java:105) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create(UndertowDeploymentInfoService.java:1541) at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252) ... 10 more Caused by: 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:976) at io.undertow.servlet.spec.ServletContextImpl.getServletRegistrations(ServletContextImpl.java:584) at com.sun.faces.util.Util.getExistingFacesServletRegistration(Util.java:160) at com.sun.faces.util.Util.getFacesServletMappings(Util.java:150) at com.sun.faces.util.Util.isResourceExactMappedToFacesServlet(Util.java:1158) at com.sun.faces.util.Util.isViewIdExactMappedToFacesServlet(Util.java:1139) at com.sun.faces.application.view.FaceletViewHandlingStrategy.handlesViewId(FaceletViewHandlingStrategy.java:946) at com.sun.faces.application.view.ViewHandlingStrategyManager.getStrategy(ViewHandlingStrategyManager.java:76) at com.sun.faces.application.view.ViewDeclarationLanguageFactoryImpl.getViewDeclarationLanguage(ViewDeclarationLanguageFactoryImpl.java:47) at com.sun.faces.application.view.MultiViewHandler.getViewDeclarationLanguage(MultiViewHandler.java:446) at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:346) at javax.faces.application.ViewHandlerWrapper.getViewDeclarationLanguage(ViewHandlerWrapper.java:346) at com.sun.faces.application.ApplicationAssociate$PostConstructApplicationListener.processEvent(ApplicationAssociate.java:324) at javax.faces.event.SystemEvent.processListener(SystemEvent.java:123) at com.sun.faces.application.applicationimpl.Events.processListeners(Events.java:253) at com.sun.faces.application.applicationimpl.Events.invokeListenersFor(Events.java:231) at com.sun.faces.application.applicationimpl.Events.publishEvent(Events.java:112) at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:127) at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788) at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:553) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:264) ... 22 more
The same application can be deployed on EAP 7.1.6, but this deployment failure happens since EAP 7.2.0 onwards.
- is cloned by
-
WFLY-13792 JSF deployment failure due to UnsupportedOperationException when javax.faces.FACELETS_VIEW_MAPPINGS is defined
- Closed
- is duplicated by
-
JBEAP-20283 JSF deployment failure due to UnsupportedOperationException when javax.faces.FACELETS_VIEW_MAPPINGS is defined
- Closed
- is incorporated by
-
JBEAP-20333 (7.3.z) Upgrade JSF based on Mojarra 2.3.9.SP12-redhat-00001 to 2.3.9.SP13-redhat-00001
- Closed
- links to