1 Reply Latest reply on Dec 14, 2016 6:16 AM by jaikiran pai

    Wildfly 10 EJB-Project injection EJB in separat JSF-Application

    Reik Loeber Newbie


      i have a problem while injection EJB's in a JSF 2.2 webapp.


      Project-Structure :



      - project-api.jar (only interfaces)

      - project-impl.jar (remote ejb's which implements the interfaces of project-api.jar





      public interface MyRemoteBean {
           public void test();



      public class MyRemoteBeanImpl implements MyRemoteBean {
           public void test(){


      Output of wildfly at deploy-time:




      I have a JSF2.2 webapp (not in the EAR-Project !)

      In the pom.xml of the webapp :



      In this way i can code against the api with no knowing of implementation.


      In a JSF-Bean :

      public class MyViewController implements Serializable {
           private static final long serialVersionUID = 1L;
           private MyRemoteBean remoteBean;
          public String uiButtonPressed(){
                log.info("bean initialized with: "+remoteBean;

      remoteBean is always null

      output of wildfly :


      WFLYWELD0044: Error injecting resource into CDI managed bean. Can't find a resource named java:comp/env/com.example.webapp.MyViewController/remoteBean


      I don't want the ejb project as an dependency of the webapp because if i have deployed the ear and later i deploy the webapp, all ejb's will be deployed twice.

      My thinking, i develop an api (the project-api.jar), the implementation (myproject-impl.jar), both packed in an ear to provide the ejb's. This ear will be deployed to wildfly. Then i can code several webapps (or whatever) and only need the myproject-api.jar as a dependency.

      I think many of provided libraries use this technic. faces-api, faces-impl for example.


      Is there a way to do so i want?


      Sorry for my english