问题 We have an app that uses Spring Data JPA repositories to inject into EJB's. Spring's org.springframework.data.jpa.repository.cdi.JpaRepositoryExtension does the magic. It looks for an EntityManager in CDI, saves it for later use, looks for Spring Data JPA repositories using the @Repository annotation, and saves their types for later use. When CDI is initialized, JpaRepositoryExtension::afterBeanDiscovery runs and to do the proper bean creation and insertion into CDI. This has worked perfectly