Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB 2.x and EJB 3 coexisting

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a scenario where the new requirements are being developed using EJB 3 Stateless beans with the old EJB 2.x CMP Entity beans. The question I have is that I read from the book EJB 3 in Action that I just need to change the ejb-jar.xml file as,



But we do not use Schema rather a DTD as below,



So in the above case, is it just enough to change the 2.0 to 3.0 to make my ejb-jar EJB 3 compatible? Please help!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is any DTD for EBJ3. I think you'll have to replace the old DOCTYPE with the new Schema format.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where can I find an example of the XML schema for EJB 3?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean a real example ? Sorry, I don't know.

By the way, the declaration you've posted above is a bit different from the official one :

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jothi Shankar Kumar Sankararaj:
Where can I find an example of the XML schema for EJB 3?


I believe, you already know that in EJB3 the ejb-jar.xml is optional. As such, most of the examples available do not use the xml and instead illustrate the annotations usage.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jaikiran Pai:


I believe, you already know that in EJB3 the ejb-jar.xml is optional. As such, most of the examples available do not use the xml and instead illustrate the annotations usage.


I know but I want to make both EJB 3 and EJB 2.0 beans co exist and for this the simplest solution that I can assume is the one that is posted above (still make use of the ejb-jar.xml).
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jothi Shankar Kumar Sankararaj:
I know but I want to make both EJB 3 and EJB 2.0 beans co exist and for this the simplest solution that I can assume is the one that is posted above (still make use of the ejb-jar.xml).


Okay. This is possible. Here's an example from the JBoss documentation.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34680
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or if you need the actual XML schema spec, Sun has it online
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic