I have the following line in my Java code
VisitContext.createVisitContext(...);
The class VisitContext is from javax.faces.component.visit
This line causes an error with following stacktrace
java.lang.IllegalStateException: Could not find backup for factory javax.faces.component.visit.VisitContextFactory.
javax.faces.FactoryFinderInstance copyInjectionProviderFromFacesContext
Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
javax.faces.FactoryFinderInstance logNoFactory
Application was not properly initialized at startup, could not find Factory: javax.faces.component.visit.VisitContextFactory. Attempting to find backup.
I have following JSF dependencies in my POM
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.3.9.SP09</version>
<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.3_spec</artifactId>
<version>3.0.0.SP04</version>
How can I fix this "factory not found" problem? Is this a bug in one of the dependencies?
What I have tried:
I already tried removing or updating the dependencies to a newer version. But then I was getting "Class not found" or other compatibility issues.