aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 2.x and EJB 3 coexisting 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 "EJB 2.x and EJB 3 coexisting" Watch "EJB 2.x and EJB 3 coexisting" New topic
Author

EJB 2.x and EJB 3 coexisting

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

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!


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

Where can I find an example of the XML schema for EJB 3?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

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

Joined: Jul 20, 2005
Posts: 10213
    
166

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.


[My Blog] [JavaRanch Journal]
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9427
    
    2

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

Joined: Jul 20, 2005
Posts: 10213
    
166

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

Joined: May 26, 2003
Posts: 30776
    
157

Or if you need the actual XML schema spec, Sun has it online


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: EJB 2.x and EJB 3 coexisting