2 Replies Latest reply on Jan 27, 2011 4:25 PM by Nicklas Karlsson

    @Named not working in JBoss 6

    Adrian Neaga Newbie

      The ear I deploy has the following structure

       

      EAR

             war

             lib\

                  jpa.jar

                  ejb.jar (references jpa.jar in MANIFEST)

       

       

      After LOTS of troubleshooting this is the topology that deploys fine and works fine in Glassfish. Only deploys fine in Jboss6M5 (same with today's noghtly Jboss build)

       

       

      Here's the bean I try to access in a JSF page:

       

      import javax.ejb.EJB;
      import javax.enterprise.context.RequestScoped;
      import javax.inject.Inject;
      import javax.inject.Named;
      import java.util.ArrayList;
      import java.util.List;

       

      @Named
      @RequestScoped
      public class BookController {

       

      .....

       

      Here's what I get:

       

      7:26:40,885 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] javax.el.PropertyNotFoundException: /listBooks.xhtml @49,57 action="#{bookController.doNew}": Target Unreachable, identifier 'bookController' resolved to null: javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: /listBooks.xhtml @49,57 action="#{bookController.doNew}": Target Unreachable, identifier 'bookController' resolved to null

       

       

       

      I tried changing the @Named annotation to JSF's ManagedBean and then the error is that CDI cannot inject the beans BookController depends on.

       

      Please let me know what's wrong with this and why it works fine in latest Glassfish 3.

       

      Thanks.