I have an application service class that is application scoped:
@ApplicationScoped
public class ApplicationService { ... }
I want to control which methods of the application service are exposed to the servlets, so there is a facade class. The interface is this:
@Local
public interface ApplicationLocal { ... }
The implementation is the facade with the injected real application service:
@Stateless
public class ApplicationFacade implements ApplicationLocal {
@Inject
private ApplicationService service;
}
The servlet class then gets the injected bean interface:
@ManagedBean
@WebServlet("/ServiceManager")
public class ServiceManagerServlet extends HttpServlet {
@Inject
private ApplicationLocal app;
}
When I do this, app is always null in the doPost and doGet methods. I get no errors from Wildfly on deployment or invocation of the servlet methods.
As always, all help is greatly appreciated.