3 Replies Latest reply on Mar 2, 2011 8:47 PM by John Asermely

    weld 1.1 stricter injection policies

    John Asermely Newbie
      Weld 1.1 seems to be more strict about injection.  Let me explain my setup and then the problem:

      Environment: netbeans 7.0 beta 2
      server: glassfish 3.1

      Two projects: 
      (project_share) The project contains my Entities and Services(which are implemented as EJBs).  This is a simple java application, meant to be shared by multiple web projects.

      (project_web) This project is the JEE web project.

      (project_web) has @Inject references to classes in (project_share) that worked in glassfish 3.0.1 and that no longer worked in glassfish 3.1.

      I was able to make them work in glassfish 3.1 by adding a /META-INT/beans.xml file in (project_share).

      Now the problem I can't seem to fix is that project_share has @Inject references to beans produced by @Produce methods that exist in project_web;  e.g.,
      (In project_share) @Inject EntityManager em; //in my Service classes
      (In project_web)   @Produces @PersistenceContext(unitName = "aps_webPU") EntityManager em;

      My project_web does have a beans.xml file which exists under the web/WEB-INF directory.

      Am I doing something wrong, or should this work?