JSF Exception: /main.jsp not found in external context as a Resource - jsf

I have a User Interface built using "IceFaces". And it's deployed on a portal built using "LifeRay". The UI application is getting undeployed automatically from the portal sometimes.
And the log is showing the following error message :
javax.servlet.ServletException: java.lang.Exception: javax.faces.FacesException: Problem in renderResponse: /main.jsp Not Found in ExternalContext as a Resource
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:175)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
-----------------
Caused by: java.lang.Exception: javax.faces.FacesException: Problem in renderResponse: /main.jsp Not Found in ExternalContext as a Resource
at com.icesoft.faces.context.View.servePage(View.java:136)
at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:55)
------------------
Caused by: javax.faces.FacesException: Problem in renderResponse: /main.jsp Not Found in ExternalContext as a Resource
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:296)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
Caused by: java.io.FileNotFoundException: /main.jsp Not Found in ExternalContext as a Resource
at com.sun.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:121)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:91)
at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:268)
... 171 more
The UI has only .xhtml pages and no jsp page so I have no idea why it's trying to render a main.jsp page.
Also, after it gets deployed again it works fine for some time before the exception resurfaces.
Will be grateful if you can provide any pointer to the root cause or how to fix this problem.
Thanks in advance

Do you have the following in your web.xml?
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

Related

OmniFaces throws java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated

I've updated to Omnifaces 3.3 using build.gradle:
compile group: 'org.omnifaces', name: 'omnifaces', version: '3.3'
My EAR can run with 3.2, but I get the following errors when deploy 3.3:
21:07:07,856 INFO [org.omnifaces.ApplicationInitializer] (ServerService Thread Pool -- 31) Using OmniFaces version 3.3
21:07:07,876 INFO [io.undertow.websockets.jsr] (ServerService Thread Pool -- 31) UT026005: Adding programmatic server endpoint class org.omnifaces.cdi.push.SocketEndpoint for path /omnifaces.push/{channel}
21:07:07,878 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 31) Initializing Mojarra 2.3.9.SP01 for context '/GoStopHandle'
21:07:08,523 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 31) Monitoring file:/usr/local/Cellar/wildfly-as/16.0.0.Final/standalone/tmp/vfs/deployment/deploymentbed7dce99d600c8e/GoStopHandleWAR.war-4113c165328ad65/WEB-INF/faces-config.xml for modifications
21:07:08,527 INFO [org.primefaces.webapp.PostConstructApplicationEventListener] (ServerService Thread Pool -- 31) Running on PrimeFaces 7.0.5
21:07:08,527 INFO [org.primefaces.webapp.PostConstructApplicationEventListener] (ServerService Thread Pool -- 31) Running on PrimeFaces 7.0.5
21:07:08,527 SEVERE [org.omnifaces.ApplicationProcessor] (ServerService Thread Pool -- 31) OmniFaces failed to initialize! Report an issue to OmniFaces.: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
at deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.ApplicationProcessor.checkDuplicateResourceHandler(ApplicationProcessor.java:88)
at deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.ApplicationProcessor.processEvent(ApplicationProcessor.java:72)
at javax.faces.api#2.3.9.SP01//javax.faces.event.SystemEvent.processListener(SystemEvent.java:123)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.processListeners(Events.java:253)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.invokeListenersFor(Events.java:231)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.publishEvent(Events.java:115)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:127)
at javax.faces.api#2.3.9.SP01//javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
at javax.faces.api#2.3.9.SP01//javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:553)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:264)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.JBossThread.run(JBossThread.java:485)
21:07:08,528 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 31) Critical error during deployment: : java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
at deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.ApplicationProcessor.checkDuplicateResourceHandler(ApplicationProcessor.java:88)
at deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.ApplicationProcessor.processEvent(ApplicationProcessor.java:72)
at javax.faces.api#2.3.9.SP01//javax.faces.event.SystemEvent.processListener(SystemEvent.java:123)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.processListeners(Events.java:253)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.invokeListenersFor(Events.java:231)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.publishEvent(Events.java:115)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:127)
at javax.faces.api#2.3.9.SP01//javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
at javax.faces.api#2.3.9.SP01//javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:553)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:264)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.JBossThread.run(JBossThread.java:485)
21:07:08,529 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 31) MSC000001: Failed to start service jboss.deployment.subunit."GoStopHandle.ear"."GoStopHandleWAR.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.subunit."GoStopHandle.ear"."GoStopHandleWAR.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
... 8 more
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:283)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at org.wildfly.extension.undertow#16.0.0.Final//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
at io.undertow.servlet#2.0.19.Final//io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
... 10 more
Caused by: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
at deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.ApplicationProcessor.checkDuplicateResourceHandler(ApplicationProcessor.java:88)
at deployment.GoStopHandle.ear.GoStopHandleWAR.war//org.omnifaces.ApplicationProcessor.processEvent(ApplicationProcessor.java:72)
at javax.faces.api#2.3.9.SP01//javax.faces.event.SystemEvent.processListener(SystemEvent.java:123)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.processListeners(Events.java:253)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.invokeListenersFor(Events.java:231)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.applicationimpl.Events.publishEvent(Events.java:115)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:127)
at javax.faces.api#2.3.9.SP01//javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
at javax.faces.api#2.3.9.SP01//javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:788)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:553)
at com.sun.jsf-impl#2.3.9.SP01//com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:264)
... 22 more
21:07:08,533 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "GoStopHandle.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"GoStopHandle.ear\".\"GoStopHandleWAR.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
Caused by: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files."}}
21:07:08,533 ERROR [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0021: Deploy of deployment "GoStopHandle.ear" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"GoStopHandle.ear\".\"GoStopHandleWAR.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
Caused by: java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files."}}
21:07:08,545 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 31) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'GoStopHandle.ear/GoStopHandleJAR.jar#goStopHandleMongoDBPersistenceUnit'
21:07:08,551 INFO [org.hibernate.orm.beans] (ServerService Thread Pool -- 31) HHH10005004: Stopping BeanContainer : org.hibernate.resource.beans.container.internal.CdiBeanContainerExtendedAccessImpl#6f289f7f
21:07:08,551 INFO [org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider] (ServerService Thread Pool -- 31) OGM001202: Closing connection to MongoDB
21:07:08,551 INFO [org.mongodb.driver.connection] (ServerService Thread Pool -- 31) Closed connection [connectionId{localValue:4, serverValue:43}] to 127.0.0.1:27017 because the pool has been closed.
21:07:08,552 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 31) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'GoStopHandle.ear/GoStopHandleJAR.jar#goStopHandleMongoDBPersistenceUnit'
21:07:08,563 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0208: Stopped subdeployment (runtime-name: GoStopHandleJAR.jar) in 29ms
21:07:08,591 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0208: Stopped subdeployment (runtime-name: GoStopHandleWAR.war) in 57ms
21:07:08,594 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0028: Stopped deployment GoStopHandle.ear (runtime-name: GoStopHandle.ear) in 60ms
21:07:10,525 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (Mojarra-WebResourceMonitor-2-thread-1) Unable to access url file:/usr/local/Cellar/wildfly-as/16.0.0.Final/standalone/tmp/vfs/deployment/deploymentbed7dce99d600c8e/GoStopHandleWAR.war-4113c165328ad65/WEB-INF/faces-config.xml. Monitoring for this resource will no longer occur.
21:15:46,752 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 42) WFLYDR0009: Content /usr/local/Cellar/wildfly-as/16.0.0.Final/standalone/data/content/71/89ba9c42dac295cdb4b7e9ccf47471afd95a22 is obsolete and will be removed
21:15:46,756 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 42) WFLYDR0002: Content removed from location /usr/local/Cellar/wildfly-as/16.0.0.Final/standalone/data/content/71/89ba9c42dac295cdb4b7e9ccf47471afd95a22/content
I run with:
PrimeFace (Elite) 7.0.5 OmniFaces 3.2
Java openjdk 11.0.2 Kotlin 1.3.41
JBoss WildFly 16.0.0.FINAL Undertow 2.0.19.Final Mojarra 2.3.9.SP01
Google Chrome Version 75.0.3770.100 (64-bit) Safari 12.1
(14607.1.40.1.4) macOS Mojave 10.14.5
java.lang.IllegalStateException: Resource handler class org.primefaces.application.resource.PrimeResourceHandler is duplicated. This will result in erratic resource handling behavior. Please check your faces-config.xml files, also in web fragment JAR files.
OmniFaces 3.3 has indeed introduced a preventive check for duplicate resource handlers in JSF configuration. See issue 504.
In your specific case, however, this literal error message is a bit unhelpful because in this specific case it's not necessarily caused by a developer mistake in faces-config.xml file in your WAR or web fragment JAR files.
It's actually caused by a developer mistake in build or runtime configuration. Your build and/or runtime classpath ended up getting duplicate PrimeFaces JAR files which each registered their own PrimeResourceHandler via their own faces-config.xml file. The PrimeFaces JAR file is essentially also a "web fragment JAR file", but actually not a custom one (hence the error message being slightly unhelpful for starters, I'll improve that for the next OmniFaces version).
In order to solve your problem you need to make sure that there's only one PrimeFaces JAR file in /WEB-INF/lib folder of the produced WAR file, and that there are no duplicates throughout the runtime classpath. In case your application is in EAR format, you also need to make sure that no one web fragment JAR file ends up in /lib folder of the produced EAR file. In case you deploy to a custom built server stack, you also need to make sure that no one web fragment JAR file is manually placed in default classpath of the server (e.g. /lib folder of Tomcat). In case you deploy to a custom built Java environment, you also need to make sure that no one web fragment JAR file is manually placed in default classpath of the JRE (e.g. /lib folder of JRE installation).

Liberty profile: birt and jsf integration

I'm building a web application running on Liberty profile 8.5, with JSF 2.0 feature enabled (jsf-2.0 in server.xml) and BIRT integration in the web app.
The web application includes all BIRT needed libs in WEB-INF/lib folder, but the only way to make it working (specially for chart report) is to set the classloader to 'parentlast' in the server.xml:
<webApplication contextRoot="MyApp" id="MyApp" location="MyApp.war" name="MyApp">
<classloader delegation="parentLast"/>
</webApplication>
In this way, I correctly see charts and reports.
But the 'parentlast' setting makes JSF not working, with this exception:
[ERROR ] SRVE0315E: An execption occurred:
com.ibm.ws.webcontainer.webapp.WebAppErrorReport:
javax.servlet.ServletException: SRVE0207E: Uncaught initialization
exception created by servlet at
com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:385)
at [internal classes] Caused by: javax.servlet.ServletException:
SRVE0207E: Uncaught initialization exception created by servlet ... 3
more
Caused by: java.lang.IllegalStateException: No Factories configured for this Application. This happens if the faces-initialization does not work at all - make sure that you properly include all configuration settings necessary for a basic faces application and that all the necessary libs are included. Also check the logging output of your web application and your container for any exceptions!
If you did that and find nothing, the mistake might be due to the fact that you use some special web-containers which do not support registering context-listeners via TLD files and a context listener is not setup in your web.xml.
A typical config looks like this;
<listener><listenerclass>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
Without the parentlast setting, the JSF pages are correctly shown, but BIRT charts don't work.
I understand this behaviour, as the parentlast classloading makes the application seeing at first the application libs, where JSF is not included (it's loaded at server scope).
Any suggestion?
Thank you in advance!

Getting " Portlet Portlet_WAR_portletID has a null portlet bag" in liferay 6.2

I created a liferay plugin portlet project and deployed in Liferay 6.2. When i try to deploy, i am getting " Portlet Portlet_WAR_portletID has a null portlet bag" error. I am not able to find the root as i could see i am referring correct plugin project.
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.liferay.portlet.PortletContextFactory._create(PortletContextFactory.java:84)
at com.liferay.portlet.PortletContextFactory.create(PortletContextFactory.java:40)
at com.liferay.portlet.PortletConfigFactoryImpl.create(PortletConfigFactoryImpl.java:56)
at com.liferay.portlet.PortletConfigFactoryUtil.create(PortletConfigFactoryUtil.java:32)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:606)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655)
at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:120)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer.access$4(PortletRenderer.java:107)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:174)
at com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:1)
at com.liferay.portal.kernel.executor.CopyThreadLocalCallable.call(CopyThreadLocalCallable.java:69)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
at java.lang.Thread.run(Unknown Source)
Redeploy your portlet again. I faced same issue. I stop server and then clean my portlet then I started my server. When I checked in browser then I got internal server and in console "
portlet contains a null bag". I deployed again and the it is coming perfectly.
The most common solution for this problem is that just undeploy the portlet from the tomcat and redeploy it.

Run javaEE from netbeans locally

I am trying to run my javaEE site locally in Netbeans IDE. I believe I have everything set up correctly, but I am receiving the following error:
Initializing... deploy?DEFAULT=C:\Documents and
Settings\nicholasr\Desktop\Work Notes\temp code
files\ASP\build\web&name=ASP&force=true failed on GlassFish Server 3.1
Error occurred during deployment: Exception while deploying the app
[ASP] : Servlet [Resource Servlet] and Servlet [Persistent Faces
Servlet] have the same url pattern: [/xmlhttp/*]. Please see
server.log for more details. C:\Documents and
Settings\nicholasr\Desktop\Work Notes\temp code
files\ASP\nbproject\build-impl.xml:871: The module has not been
deployed. at
org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:187)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106) at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348) at
org.apache.tools.ant.Target.execute(Target.java:390) at
org.apache.tools.ant.Target.performTasks(Target.java:411) at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at
org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
BUILD FAILED (total time: 58 seconds)
I've done some searching on the net, but don't see any related links. Does anyone know why I would be getting this error and how it can be resolved? I can provide any additional information if needed. Thanks!
Error occurred during deployment: Exception while deploying the app [ASP] : Servlet [Resource Servlet] and Servlet [Persistent Faces Servlet] have the same url pattern: [/xmlhttp/]*
You seem to be using IceFaces. I don't do IceFaces, but the error message suggests that they shouldn't be mapped on the very same URL pattern. I did some minor research and based on the following documents...
Adding IceFaces 2 to your application
Converting IceFaces 1.8 to IceFaces 2
The previously declared Persistent Faces Servlet and Blocking Servlet are no longer needed in ICEfaces 2, as their functionality has changed and setup has been reduced. Remove all declarations and mappings for those two servlets:
... I can only conclude that the "Persistent Faces Servlet" is typical for IceFaces 1.8.x and the "Resource Servlet" is typical for IceFaces 2.x. You should use the one or the other, not both. I think you're targeting IceFaces 2.x, so you should get rid of the declaration and the mapping of the "Persistent Faces Servlet" in your web.xml altogether.

IntelliJIdea, error in deployment of spring + JSF application

In IntelliJIdea, i've created a little application with just default pages auto created by ide. I've added two frameworks: spring (3) and JSF 2. The app level is java ee 2.5, because I want to deploy on a Tomcat 6.0.
I installed an Apache Tomcat 6.0, created an administrator user, and tested, it works.
But when I deploy the simple application, it seems to deploy it correctly, but accessing it, the browser gives the error:
Simple jsp page
12: <body>
13:
14: f:view>
15:
16:
17:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:519)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:428)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause
java.lang.RuntimeException: FacesContext not found
....
java.lang.RuntimeException: FacesContext not found
The JSF component is complaining that the FacesContext cannot be found. The FacesServlet is the one responsible for creating it. So it has clearly not run. You need to ensure that the request URL as you entered in the browser address bar matches the URL pattern of the FacesServlet as it is been definied in the webapp's web.xml file (and that it is been definied in the web.xml). If it is for example
<url-pattern>*.jsf</url-pattern>
then you need to ensure that the request URL is
http://localhost:8080/contextname/page.jsf
and thus not
http://localhost:8080/contextname/page.jsp
If the request URL matches the URL pattern of the FacesServlet, then it will be invoked and it will do all the JSF jobs.
Unrelated to the problem: why the choice for JSP when you're using JSF2? Why not using its superior successor Facelets instead?
I encountered the same problem. The solution for me was to use the URL "http://localhost:8080/index.faces".

Resources