2

Spring Boot 3 gives with its milestones the customers time to migrate from Java EE to Jakarta, changing package names from javax to jakarta. But it's more than package names. I can't get Spring Boot to run with JSF, let alone Primefaces-Jakarta.

All solutions I try, seem to either rely on CDI, and then complain there is no working CDI, --> because Spring Boot has another injection mechanism, this isn't Glassfish. Or it complains it can't find the factories, like this:

Servlet.init() for servlet [facesServlet] threw exception
    java.lang.IllegalStateException: Keine Factory als Backup für jakarta.faces.lifecycle.LifecycleFactory gefunden.
        at jakarta.faces.FactoryFinderInstance.notNullFactory(FactoryFinderInstance.java:496) ~[jakarta.faces-api-4.0.1.jar:na]
        at jakarta.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:190) ~[jakarta.faces-api-4.0.1.jar:na]

If I set factory class names manually, they want CDI again, and I'm back where I started (and I don't want to have Spring and CDI existing in parallel anyway).

I use the latest versions of the Jakarta libraries and Spring Boot milestones. Like "jakarta.faces:jakarta.faces-api:4.0.1", "org.glassfish:jakarta.faces:4.0.0" and "org.springframework.boot:spring-boot-starter-web:3.0.0-M4".

Is there any tutorial, open-source project or anything else which shows how it's done?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Jan
  • 1,032
  • 11
  • 26

1 Answers1

2

Adding at the end of your faces config following could help:

servletContext.setAttribute(com.sun.faces.RIConstants.FACES_INITIALIZER_MAPPINGS_ADDED, Boolean.TRUE);
  • Thanks. But I "gave up" and ended, like I guess many people, using JoinFaces (http://joinfaces.org/). But I keep this in mind if I run into similiar problems with JoinFaces in the future. – Jan Sep 16 '22 at 10:12