[
https://issues.jboss.org/browse/AS7-5074?page=com.atlassian.jira.plugin.s...
]
Bruno Borges commented on AS7-5074:
-----------------------------------
This is the stacktrace I got
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011058:
Failed to install component Bootstrap
at
org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:100)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS014544:
No EJB found with interface of type 'com.mycompany.SharedBean' for binding
com.m4u.infosender.Bootstrap/sharedBean
at
org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:88)
at
org.jboss.as.ee.component.deployers.ComponentInstallProcessor.processBindings(ComponentInstallProcessor.java:245)
at
org.jboss.as.ee.component.deployers.ComponentInstallProcessor.access$000(ComponentInstallProcessor.java:74)
at
org.jboss.as.ee.component.deployers.ComponentInstallProcessor$1.handle(ComponentInstallProcessor.java:199)
@Inject'ed bean at another @Singleton is null on @PostConstruct
(both with @Startup)
------------------------------------------------------------------------------------
Key: AS7-5074
URL:
https://issues.jboss.org/browse/AS7-5074
Project: Application Server 7
Issue Type: Bug
Components: CDI / Weld, EJB
Affects Versions: 7.1.1.Final
Reporter: Bruno Borges
Assignee: Stuart Douglas
Labels: injection, postconstruct, singleton, startup
module-a.jar and module-b.jar are both TL (top-level) delpoyments on JBoss AS 7.1.1
* module-a.jar has a @Singleton/@Startup named SharedBean
* module-b.jar has a @Singleton/@Startup named Bootstrap
module-b.jar depends on module-a.jar through jboss-deployment-structure.xml:
<jboss-deployment-structure>
<delpoyment>
<dependencies>
<module name="deployment.module-a.jar" />
</dependencies>
</deployment>
</jboss-deployment-structure>
When I enable module-a.jar, SharedBean is started fine (it has a @PostConstruct that logs
its state)
When I enable module-b.jar, Bootstrap fails checking the @Inject'ed SharedBean on its
@PostConstruct
Files:
-------------------------
# module-a.jar
@Startup
@Singleton
public class SharedBean {
@PostConstruct
public void started() {
LOGGER.info("SharedBean has started");
}
}
-------------------------
# module-b.jar
@Startup
@Singleton
public class Bootstrap {
@Inject
private SharedBean sharedBean;
@PostConstruct
public void started() {
LOGGER.info("sharedBean is null? " + (sharedBean == null));
}
}
There's no ClassNotFoundException or NoClassDefFoundError. The bean is just not
injected correctly.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira