does anybody know if it is possible to iteratively replace EJB2.1 beans with EJB3 beans in Java EE application?
That is: at one time remove one 2.1 bean from the code and add corresponding EJB3 bean that implements the same behavior without touching the rest of the code (+ be able to inject the legacy EJBs via annotations in the new EJB3).
I am not expert at EJB specs (and I have experience only with EJB3), but to me EJB is a simply component with given business interface that is managed by the appserver. AFAIK EJB3 brought big simplification how to write the component (no artifical interfaces) and most of the time xml descriptor can be omitted thanks to the annotations, but the basics are the same. So it is seem plausible, it could work.
Is there any incompatibility between EJB2.1 & EJB3?
The core of the question is if migration EJB2.1 --> EJB3 needs to be stop-the-world/complete-rewrite operation or one can do it while adding new feature and fixing bugs to the legacy application (so there will be mix of EJB2.1 and EJB3 for some time in the running app).
EDIT:
- I am interested in session beans only.
- I am curious if (and how) the lookup will work. AFAIK EJB2.1 requires something called home interface to get a reference to a different EJB, but EJB3 does not have home interface ...