0 Replies Latest reply on Sep 1, 2010 4:41 AM by nimo stephan

    Event-Producer is not eligible for injection

    nimo stephan Master

      I have this:



      @SessionScoped @Named
      public class MyBean implements Serializable{
      
      private static final long serialVersionUID = -2264581005083376327L;
      
      
      // This returns the error: "No bean is eligible for injection to the injection point"
      @Inject @Any Event<Book> book;
      
      ..}




      and the injection of book returns this error:


      "No bean is eligible for injection to the injection point"



      I have did it like the example in Weld-Speci 11.3. Event producers, but it does not work.



      Another point is:


      Using this in the code:



      public void do(){
      
      ...
      // AnnotationLiteral: The serializable class  does not declare a static final serialVersionUID field of type long
      myEvent.select(new AnnotationLiteral<Read>(){}).fire(book);
      
      }



      returns this warning for the Class AnnotationLiteral:


      The serializable class  does not declare a static final 
      serialVersionUID field of type long