-
Bug
-
Resolution: Done
-
Major
-
None
-
None
@Resource BundleContext injection fails with
21:04:12,978 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "managed-bean.ear" 21:04:12,987 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "managed-bean.jar" 21:04:12,988 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "managed-bean.war" 21:04:13,066 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment managed-bean.ear 21:04:13,097 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment managed-bean.war 21:04:13,099 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016002: Processing weld deployment managed-bean.jar 21:04:13,114 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016005: Starting Services for CDI deployment: managed-bean.ear 21:04:13,137 INFO [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011907: Register module: Module "deployment.managed-bean.ear:main" from Service Module Loader 21:04:13,141 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment managed-bean.ear 21:04:13,187 INFO [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011907: Register module: Module "deployment.managed-bean.ear.managed-bean.war:main" from Service Module Loader 21:04:52,328 INFO [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011907: Register module: Module "deployment.managed-bean.ear.managed-bean.jar:main" from Service Module Loader 21:04:52,402 INFO [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /managed-bean.war 21:04:52,607 INFO [org.jboss.as.server] (management-handler-thread - 3) JBAS015870: Deploy of deployment "managed-bean.ear" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.managed-bean.\"managed-bean.jar\".env.\"org.jboss.as.test.integration.osgi.resource.SimpleManagedBean\".context Missing[jboss.naming.context.java.module.managed-bean.\"managed-bean.jar\".BundleContext]","jboss.deployment.subunit.\"managed-bean.ear\".\"managed-bean.jar\".jndiDependencyService Missing[JBAS014861: <one or more transitive dependencies>]","jboss.deployment.subunit.\"managed-bean.ear\".\"managed-bean.jar\".component.SimpleManagedBean.START Missing[JBAS014861: <one or more transitive dependencies>]"]}
This is probably because of this code in BundleContextBindingProcessor
if (comp.getNamingMode() == ComponentNamingMode.CREATE) {
ServiceName serviceName = contextServiceNameOfComponent(moduleDesc.getApplicationName(), moduleDesc.getModuleName(), comp.getComponentName());
bindServices(depUnit, serviceTarget, moduleDesc, comp.getComponentName(), serviceName);
}
The namingMode == USE_MODULE and the BundleContextdoes not get bound.
Is this binding logic correct?