Skip to content

Interface CDI wildfly external projects

So my idea is to have 3 projects:

  1. com.tests.interfaces
  3. com.tests.schedulers

com.tests.interfaces basically is:

public interface IFoo {
    public String test(); 
} is:

@Stateless(name = "IFoo")
public class FooBean implements IFoo {

    public String test() {
        return "Hello world";


I am deploying the “services” project and it works fine using wildfly 24.0.0. Then I am trying to have another .war project called: com.tests.schedulers which looks like this:

public class TestEjb {

    @EJB(beanName = "IFoo")
    IFoo iFoo;
    public void teste() {

public class ExecutorMainframeProcessamento {

    TestEjb testEjb;

    @Schedule(second = "*/5", minute = "*", hour = "*", dayOfWeek = "*", persistent = false, info ="Test EJB")
    public void atSchedule() {

But it cant be deployed and this is the relevant part of wildfly’s (same server to all .wars) output:

Caused by: WFLYEJB0405: No Jakarta Enterprise Beans found with interface of type 'com.tests.interfaces.IFoo' and name 'IFoo' for binding com.tests.schedulers.TestEjb/iFoo

What am I missing or doing wrong?



You cannot refer a class in one WAR from a class in another WAR (unless both are in the same EAR).

This is by design!

Note that you can have all your projects in separate JAR files which are put in the same WAR file which then share their classpath when deployed. This is how it is typically done. Either convert your projects to Maven projects and refer to artifacts, or have your IDE help you create the single WAR.