5 Replies Latest reply on Nov 3, 2009 10:09 PM by Shervin Asgari

    Jboss Seam Context Lookup Erros

    Tiago Frazão Newbie
      Hello,

      I have a strange problem using the Jboss Seam 2.2.0 GA*
      *I tried everything before sent this message to this forum

      For explain my problem, i will expose bellow all details.

      1) Architecture :

         ViewService - SessionBean - DAO - JPA


      2) Classes :

      @Name("viewService")
      ViewService {
        @In("categorySessionBean")
        private ICategorySessionBean categorySessionBean;
      }


      @Stateless
      @Name("categorySessionBean")
      public class CategorySessionBean implements ICategorySessionBean {
        @In(create = true)
        private CategoryDAO categoryDao;
      }

      @Name("categoryDao")
      public class CategoryDAO {Problem : My Action never find the registered Components. @In

        @In(create = true)
        protected EntityManager em;
      }


      3) Enviroment :

         Eclipse (3.4.2) + Maven + WTP 2.0 + Jboss AS 5.1.0.GA


      Well..

      Always that I try lookup the SessioBean in ViewService, the Jboss show me a Exception : "@In attribute requires non-null value: ViewService.categorySessionBean"
      I discovered that Jboss Seam has a class (org.jboss.seam.init.Initialization) which responsible to startup all component (written @Name) in application.

      When this Initialization class is running, this class add a suffix (Initialization.COMPONENT_SUFFIX) in the @Name of my component, so When I try lookup the component (in Context) is not possible, because this suffix was included in the real name.

      Someone know what wrong I am doing ? :S

      Thanks for your help.