7 Replies Latest reply on Feb 27, 2007 12:57 AM by gavin.king

    injection into stateless bean (which is called from an MDB)

    codelion

      Wrote a MDB months ago, used @PersistenceContext and @EJB to inject. Inside the MDB via one of those @EJB got a stateless bean and called a method in it (to do the actual task). That stateless bean also used @PersistenceContext, @Resource and @EJB.

      Then I wanted to make better use of Seam, so I started using @In in the stateless bean instead of @EJB.

      Now when executing I get NPE because these @In fields have nothing in them. The NPE occurs where the field is used because it is null, NOT earlier. I did NOT make required=false.

      Is there an obvious problem?

      Ref doc 3.2.5. Message-driven beans reads "Message-driven beans may not be bound to a Seam context. Nor do they have access to the session or conversation state of their caller. However, they do support bijection and some other Seam functionality."

      So what can I inject then?

      One of my null @In fields was supposed to get a proven stateless bean of mine which has a @Name, the other a ManagedQueueSender Seam component.