aspose file tools *
The moose likes EJB and other Java EE Technologies and the fly likes What is the difference between importing a POJO and injecting an EJB? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "What is the difference between importing a POJO and injecting an EJB?" Watch "What is the difference between importing a POJO and injecting an EJB?" New topic
Author

What is the difference between importing a POJO and injecting an EJB?

J Nix
Greenhorn

Joined: Oct 10, 2011
Posts: 9
As I was attempting to create a Dynamic Web Project in eclipse I received some notifications in eclipse telling me that I had to not only reference the EJB in the build but import that EJB package in addition to the @EJB dependency injection I used.

Can anyone help me clarify why all three are needed and what exactly is going on. The reason I ask is because to me importing the EJB package alone would be enough to put the EJB class in scope of the calling class, and this indicates that I do not yet have a clear understanding of what JEE6 is trying to achieve with annotations.

Thank you,
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

The basic difference between import and injection is, compile time checking for the methods, types which are referenced in our java class from some package and injection does create property/object/methods dynamically from the annotation implemented java class.
If anyone have better ideas, you welcome to share with us. Hope this helps.


No pain, No gain.
OCJP 1.6
 
 
subject: What is the difference between importing a POJO and injecting an EJB?