Hi I have 3 projects: EAR, EJB and (dynamic) WEB. I'm using eclipse and wildfly 10.x. Here's what I've got in EJB project:
package q.w.e;
public interface Inter {
public String s();
}
and
package q.w.e;
public class Ert implements Inter {
@Override
public String s() {
return "hik";
}
}
Here's what I have in dynamic web project:
package local.bb.lab.servlets;
import java.io.IOException;
import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import q.w.e.*;
public class Home extends HttpServlet {
private static final long serialVersionUID = 1L;
@EJB
Inter ert;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getRequestDispatcher("/home.jsp").forward(request, response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
All very simple. I connected the projects using EAR. The compiler sees the package and classes but I'm having this error:
WFLYEJB0406: No EJB found with interface of type 'q.w.e.Inter' for binding local.bb.lab.servlets.Home/ert
I have no idea why it remains there. This must be some configuration problem but I connected them just as it was shown in tutorials(took literaly the same steps).