[jboss-user] [JBoss Seam] - injection into stateless bean (which is called from an MDB)

codelion do-not-reply at jboss.com
Thu Feb 22 04:03:44 EST 2007


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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020453#4020453

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020453



More information about the jboss-user mailing list