1 Reply Latest reply on Jan 19, 2011 8:03 PM by alesj

    Conversation not injected in JSF bean - JBoss 5..0.0 EAP

    jerarckill

      Hello everybody,


      In the scope of a proof of concept, we have to integrate JSF2 and Weld in a Struts 1 application (I know, it's crazy to still use this nowadays) working on JBoss 5 (v5.1.0 EAP).
      So, we managed to update all the dependencies to make it work but we are now stuck with the conversation scope.
      to be more precise, the conversation is not injected in our JSF bean with the @Inject annotation.


      Here is the faulty bean class (simplified version):




      package org.whatever.web.jsf2.beans;
      
      import java.io.Serializable;
      
      import javax.enterprise.context.Conversation;
      import javax.enterprise.context.ConversationScoped;
      import javax.inject.Inject;
      import javax.inject.Named;
      
      @ConversationScoped
      @Named
      public class MultiCriteriaSearchBean implements Serializable {
      
           @Inject
           private Conversation conversation;
      
           public MultiCriteriaSearchBean() {
                super();
      
                conversation.begin();
           }
      
           public void performSearch() {
                // Performs the search here...
      
                conversation.end();
           }
      
      }





      Note that, apart of this, all the rest works: JSF works, as is injection of any other bean.  It's like the conversation provider always returns null or something...
      Any help appreciated!


      Jérôme Jadoulle