WFLYEJB0406: No Jakarta Enterprise Beans found with interface / WFLYEE0047: Incompatible conflicting binding trying to inject @EJB in EAP 7

Solution Verified - Updated -

Issue

  • Application failing to deploy, when trying to use @EJB to inject an ejb.
18:02:42,252 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.subunit."example-app.ear"."example-ejb-module.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."example-app.ear"."example-ejb-module.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "example-ejb-module.jar" of deployment "example-app.ear"
...
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0052: Failed to install component TestSingleton
    at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:109)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
    ... 8 more
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEJB0406: No Jakarta Enterprise Beans found with interface of type 'examples.ejb.ExampleSingletonBean' for binding test.TestSingleton/singleton
    at org.jboss.as.ejb3.deployment.processors.EjbInjectionSource.getResourceValue(EjbInjectionSource.java:90)
    at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.processBindings(ComponentInstallProcessor.java:261)
    at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.access$000(ComponentInstallProcessor.java:80)
    at org.jboss.as.ee.component.deployers.ComponentInstallProcessor$1.handle(ComponentInstallProcessor.java:213)
    at org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
    at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:216)
    at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:101)
    ... 9 more

This TestSingleton is trying to use @EJB to inject ExampleSingletonBean:

@Startup
@Singleton(name="TestSingleton")
public class TestSingleton {
    @EJB
    private ExampleSingletonBean singleton;
@Startup
@Singleton(name="ExampleSingletonBean")
public class ExampleSingletonBean implements ExampleSingleton
  • When hot deploying the application after EAP was started, this error also showed up WFLYEE0047: Incompatible conflicting binding :
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."example-app.ear"."example-ejb-module.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."example-app.ear"."example-ejb-module.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "example-ejb-module.jar" of deployment "example-app.ear"
...
Caused by: java.lang.IllegalArgumentException: WFLYEE0047: Incompatible conflicting binding at java:jboss/exported/example-app/example-ejb-module/ExampleSLSBBean!examples.ejb.ExampleSLSB source: org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor$2@3f566732
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:300)
    at org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:124)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
    ... 8 more

Environment

Red Hat JBoss Enterprise Application Platform (EAP) 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content