Could not find backup for factory javax.faces.context.FacesContextFactory

See original GitHub issue

Hello,

We are shifting a JEE app from Wildfly to Spring Boot.

I’ve updated our pom.xml to use joinfaces:

<parent>
	<groupId>org.joinfaces</groupId>
	<artifactId>joinfaces-parent</artifactId>
	<version>3.2.0</version>
	<relativePath />  
</parent>

<dependency>
	<groupId>org.joinfaces</groupId>
	<artifactId>primefaces-spring-boot-starter</artifactId>
</dependency>
<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-aop</artifactId>
	<version>2.0.2.RELEASE</version>
</dependency>
<dependency>
	<groupId>org.springframework.data</groupId>
	<artifactId>spring-data-jpa</artifactId>
	<version>2.0.6.RELEASE</version>
</dependency>

Running the Spring Boot application from Eclipse Oxygen reports the application has started. However, when I navigate to a page in the application in the browser, I get the following stacktrace:

2018-05-13 21:29:24.539  INFO 95060 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-05-13 21:29:24.591  INFO 95060 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2018-05-13 21:29:24.594  INFO 95060 --- [           main] com.viableit.AthApplication                  : Started AthApplication in 11.857 seconds (JVM running for 12.267)
2018-05-13 21:29:33.535 ERROR 95060 --- [nio-8080-exec-1] javax.faces                              : Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
2018-05-13 21:29:33.535 ERROR 95060 --- [nio-8080-exec-1] javax.faces                              : Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory. Attempting to find backup.
2018-05-13 21:29:33.539 ERROR 95060 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : StandardWrapper.Throwable

java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
  at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:541) ~[javax.faces-2.3.4.jar:2.3.4]
  at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:292) ~[javax.faces-2.3.4.jar:2.3.4]
  at javax.faces.webapp.FacesServlet.init(FacesServlet.java:374) ~[javax.faces-2.3.4.jar:2.3.4]
  at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1144) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:789) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]

2018-05-13 21:29:33.541 ERROR 95060 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[FacesServlet]         : Allocate exception for servlet [FacesServlet]

java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
  at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:541) ~[javax.faces-2.3.4.jar:2.3.4]
  at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:292) ~[javax.faces-2.3.4.jar:2.3.4]
  at javax.faces.webapp.FacesServlet.init(FacesServlet.java:374) ~[javax.faces-2.3.4.jar:2.3.4]
  at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1144) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:789) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:133) ~[tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_25]
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_25]
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.29.jar:8.5.29]
  at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]

I see that the Mojarra jars were resolved in the pom.xml so they are present. I don’t see any MyFaces jar files. I am not sure how to proceed further in troubleshooting this issue. Does anybody have any ideas that could help me out?

Thanks! Dave

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
larsgrefercommented, Nov 28, 2019

@vitsin In your case the following line causes the problem:

server.tomcat.additional-tld-skip-patterns=*.jar

tomcat would normally find the ConfigureListener in jakarta.faces-2.3.13.jar!/META-INF/jsf_core.tld:64

0reactions
jacob2221commented, Jun 27, 2022

@vitsin Were you able to resolve the latest error?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.IllegalStateException:Could not find backup for ...
IllegalStateException:Could not find backup for factory javax.faces.application.ApplicationFactory · Ask Question. Asked 9 years, 2 months ago.
Read more >
Could not find backup for factory javax.faces.context ...
java.lang.IllegalStateException : Could not find backup for factory javax.faces.context.FacesContextFactory (Doc ID 2122194.1).
Read more >
Error: Could not find backup for factory javax.faces.context. ...
While deploying, I am getting error. How to resolve it. java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.
Read more >
Getting javax.faces.application.ApplicationFactory error ...
IllegalStateException : Could not find backup for factory javax.faces.application.ApplicationFactory. at javax.faces.
Read more >
Could not find backup for factory javax.faces.context. ...
IllegalStateException during portlet deployment on WebLogic: Could not find backup for factory javax.faces.context.FacesContextFactory. Status: Assignee:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found