-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
39.0.0.Beta1
-
None
The spring-resteasy quickstart fails to deploy to the server with a BeanManager lookup error.
Error:
Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:5.1.5.Final:deploy (default-cli) on project spring-resteasy: Failed to execute goal deploy: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"spring-resteasy.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003935: Unable to instantiate InjectorFactory implementation. Caused by: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003935: Unable to instantiate InjectorFactory implementation. Caused by: java.lang.RuntimeException: RESTEASY003935: Unable to instantiate InjectorFactory implementation. Caused by: java.lang.RuntimeException: RESTEASY010605: Unable to lookup BeanManager."},"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"spring-resteasy.war\".beanmanager"],"WFLYCTL0180: Services with missing/unavailable dependencies" => ["service jboss.deployment.unit.\"spring-resteasy.war\".batch.artifact.factory is missing [jboss.deployment.unit.\"spring-resteasy.war\".beanmanager]"]}}}
Root Cause Analysis
1. Missing resteasy-spring library
The resteasy-spring integration is no longer bundled with WildFly. It moved to a separate project (org.jboss.resteasy.spring:resteasy-spring) and must be added as a dependency.
2. CDI subsystems conflict with Spring
Spring doesn't support CDI. These subsystems try to initialize BeanManager and fail:
- weld - CDI implementation
- batch-jberet - uses CDI for batch artifacts
- jaxrs - RESTEasy CDI integration
- jsf - Jakarta Faces requires CDI
Solution
Add resteasy-spring dependency to pom.xml and exclude CDI-dependent subsystems (weld, batch-jberet, jaxrs, jsf) in jboss-deployment-structure.xml with explicit RESTEasy module dependencies.