I\'m reasonably new to Java EE, so this might be stupid.. bear with me pls :D
I would like to inject a stateless session bean into a message-driven bean. Basically,
I think the problem of the very first example is that you are trying to inject the implementation of the EJB and not its interface. The local no-interface view of EJB 3.1 is just possible if you do not define any interface, not even a remote one. So changing the injection point to the following should work out:
@EJB
private TestBeanRemote testBean;
If you are using your application within a non clustered environment, so single JVM, you should think about changing the interface to @Local. As soon as you are accessing EJBs using their remote interface, you are getting a lot of overhead. Parameters and return values can not be accessed by reference anymore, but by value, as they are always copied (specification says so). This might lead to performence issues when dealing with more complex objects.
Hoped that helped.