1 Reply Latest reply on Jul 12, 2018 9:33 AM by jewellgm

    Can not inject EJB into ManagedBean inside EAR


      Hi All,


      I try to deploy EJB EAR project on WildFly 10 / WildFly 13 versions, but both versions gives an error. You can find my project structure as summary.

      RemoteEJB bean could not be injected into ManagedBean, thats why I ended up with NullPointerException.



      @ManagedBean(name = "ManagedBeanSample", eager = true)


      public class ManagedBeanSample{


      private ParamEJBRemote paramEJBRemote; // Which gives NPE, I tried to inject with full path but not work. ( @EJB(lookup="java:global/......")


      public void init() {

      // CALL EJB







      public interface ParamEJBRemote {









      public class ParamEJB implements ParamEJBRemote, ParamEJBLocal {

      public void doSmthg() {






      Do you have any solutions to solve this problem?


      Have a nice day?


      Best Regards

        • 1. Re: Can not inject EJB into ManagedBean inside EAR

          Have you tried removing the @Remote annotation from the ParamEJB class?  Since it's implementing an interface that is also annotated with @Remote, annotating the class isn't needed.  Also, are you sure the lookup you are providing is actually the lookup that wildfly is assigning to the bean?  I've seen cases where people expect the lookup to be slightly different than what it actually is, and don't check the server.log file to see what it really is.